Automatic identification system for surface corrosion area of hydraulic mechanical equipment
By designing an automatic identification system on the surface of hydraulic machinery and equipment, combined with the YOLO target detection algorithm and lightweight corrosion target detection network model, the rapid identification and real-time transmission of rusted areas are achieved, solving the safety risks and low efficiency of manual inspections. , providing an efficient corrosion detection method.
Patent Information
- Application Number
- CN202410633202.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-08-27
AI Technical Summary
The corrosion detection of hydraulic machinery and equipment relies on manual inspection, which has the problems of high safety risks, high labor intensity, low detection efficiency, and it is difficult to achieve efficient detection in harsh environments.
An automatic identification system for corrosion areas on the surface of hydraulic machinery and equipment is designed. It uses image sensors and video surveillance technology combined with the YOLO target detection algorithm to achieve automatic identification and real-time image transmission of rust areas through a lightweight corrosion target detection network model. The system includes basic hardware such as image sensors, storage modules, video processing modules and software systems such as system basic software and drivers, communication connections and corrosion target detection algorithms, which can achieve rapid detection and real-time monitoring of corrosion areas on the mobile terminal.
It achieves rapid identification and real-time transmission of rusted areas, reduces the risk and labor intensity of manual inspections, improves detection efficiency, provides an objective assessment of the surface corrosion of hydraulic machinery and equipment, and avoids the strong subjectivity and labor intensity of traditional methods. Reliability is low.
Smart Images

Figure CN118552831A
Abstract
Description
Technical Field
[0001] The invention relates to the field of rusted area recognition and image transmission of hydraulic machinery and equipment, and in particular to an automatic recognition system for rusted areas on the surface of hydraulic machinery and equipment. Background Art
[0002] Affected by the service environment, it is inevitable that rust will grow on the surface of hydraulic machinery and equipment. The generation of rust causes a certain degree of attenuation in the strength, toughness and plasticity of the metal materials in the area where it is located, which is the main hidden danger affecting the safe operation of hydraulic machinery and equipment. First of all, rust will cause the metal on the surface of the equipment to gradually corrode, greatly reducing its strength and toughness. This will lead to a decline in the structural performance of the equipment, or even serious structural damage, thus affecting the normal operation and reliability of the equipment. Secondly, the generation of rust will affect the normal operation of the equipment, and may even cause the equipment to fail and be unable to operate, which will greatly affect the operating efficiency and increase the cost of maintenance and repair. Therefore, for hydraulic machinery and equipment, it is very important to conduct timely inspections to discover areas where rust occurs and carry out effective maintenance and care.
[0003] At present, the inspection of hydraulic machinery and equipment mainly relies on manual visual inspection, and generally well-trained professionals conduct comprehensive evaluation of the rusted areas according to relevant national standards and standard sample drawings. However, in the actual operation process, due to the limitations of the operating environment of hydraulic machinery and equipment, the previous detection methods are time-consuming and labor-intensive, with high safety risks, high labor intensity, and low detection efficiency. With the continuous development of embedded technology, intelligent monitoring equipment can monitor hydraulic machinery and equipment in real time, effectively improve work efficiency, and reduce costs. It is an alternative solution to reduce the labor intensity and safety risks of manual inspections. Summary of the invention
[0004] In view of the above problems, the purpose of the present invention is to design an automatic identification system for rusted areas on the surface of hydraulic machinery and equipment. This system can overcome the problems of harsh working environment and small space of hydraulic machinery and equipment. It needs to have the characteristics of high portability and low power consumption. At the same time, it can also collect patterns of rusted areas on the surface of hydraulic machinery and equipment through video monitoring technology. The detection method is more flexible, and it is easier to obtain information such as the distribution status, rusted area, and rusted color of rust defects on the surface of hydraulic machinery and equipment, which facilitates the subsequent relatively objective evaluation of the degree of rust, so as to achieve the purpose of rusted area identification and real-time transmission of detection images.
[0005] In order to realize the above-mentioned technical features, the object of the present invention is realized as follows: a system for automatically identifying rusted areas on the surface of hydraulic machinery and equipment, including basic hardware and software systems; the basic hardware includes image sensors, storage modules, serial port modules, Ethernet modules, clock and reset circuits, power modules, video input modules, video processing modules and video encoding modules; the software system includes system basic software and drivers, communication connections and rust target detection algorithms; the system basic software and drivers include: PC-side configuration of virtual environment, transplantation of HiSilicon cross-compilation tools, production of U-Boot image files and core Linux, production of root file systems and file burning, WIFI driver burning and IMX334 driver burning; the rust target detection algorithm includes the design of YOLO target detection algorithm and the construction of a lightweight rust target detection network model.
[0006] The image sensor uses the IMX334 image sensor; storage module: LPDDR4 and eMMC5.1 chips are used; serial port module: the serial port is a serial communication interface based on the RS232 transmission protocol, which is used for device data transmission. When the PC debugs the embedded device, a USB adapter can be used to replace the serial port to complete the communication with the PC; Ethernet network module: the Ethernet module transmits image data to the back-end device through the gigabit interface, and the GMAC is responsible for managing the data transmission task and ensuring data integrity; clock and reset circuit: the clock circuit provides system timing signals, including crystal oscillators and RTC circuits, and the reset circuit ensures that the system returns to the initial state at startup or under abnormal conditions, ensuring system stability and normal operation; power supply module: the hardware circuit includes a variety of voltage outputs: 12V main power supply, 5V video encoding / USB, 3.3V serial port, 1.1V LPDDR4, 1.8V eMMC5.1 / PHY, 0.8V core; Video input module: In the Hi3519AV100 chip, the VI module is responsible for receiving the video signal collected by IMX334 and converting it into digital video data, and optimizing the image quality through ISP processing; Video processing module: VPSS, as the video processing core of HiSilicon chip, completes image enhancement, denoising, and resolution conversion processing through multi-channel collaborative work; Video encoding module: VENC is responsible for compressing and encoding video image data, including image input, encoding processing and bitstream output, improving encoding quality through advanced algorithms, and realizing data storage and transmission.
[0007] During the construction of the basic system software and drivers, the Linux system is implanted through the collaborative work of the PC, Hi3519AV100 development board and Linux server.
[0008] The specific steps for building the system software and driver are as follows: Step 1: Configure the virtual environment on the PC: Install VMware and Ubuntu systems on the PC, set the interpreter to bash, configure the network to NAT mode, install common tools git, X86, and u-boot, build an NFS server, and restart after configuration; Step 2: Copy the arm-himix200-linux file provided by HiSilicon to the Ubuntu desktop, install the compiler and decompress the SDK file Hi3519AV100_SDK_V2.0.2.0, and run sdk.unpack to expand the compilation tool; Step 3: U-Boot image file and kernel Linux production: Hi3519AV100 embedded development board uses U-Boot image file to start the system and load Bootloader program; copy the configuration file to the kernel through instructions, generate U-Boot image file, and then generate system kernel image file; Step 4: Make the root file system and burn the files: Select rootfs_Hi3519ac100_64k.jffs2 as the rootfs in the SDK, and there is no need to make the root file system; transfer the ulmage, rootfs, and bin files to the SPI Flash and burn them using the HiSilicon HiTool tool; after completion, implant the image sensor and WIFI driver; Step 5: Burn the WIFI driver: Unzip the wireless network card driver file to the Linux virtual machine, modify the configuration file to convert the driver mode to ARM, set the installation path and compile. Use the HiTool tool to burn the .ko driver file to the development board to complete the network configuration; Step 6: Burn the IMX334 driver: Copy the downloaded IMX334 driver file to the specified path and decompress and install it, and use the make command to compile it.
[0009] Specifically, the basic hardware transmits control signals and video data streams through TCP and UDP protocols. TCP ensures data integrity, UDP realizes real-time transmission, and combines RTSP and RTP protocols to realize real-time monitoring screen transmission. The RTCP and RTP protocols are combined to improve data quality feedback and control data packet transmission, so as to achieve real-time monitoring screen transmission between the device and the PC.
[0010] Specifically, the YOLO target detection algorithm includes six modules: a YOLOv5 network structure including full-dimensional dynamic convolution, a polarization self-attention module, a pooling structure SimSPPF, a bounding box regression loss function, a surface corrosion target detection model for hydraulic machinery and equipment, and preparation and training of a data set. The corrosion target detection model is defined and improved through these six modules, and the improved network parameters obtained through training have excellent performance.
[0011] The construction of a lightweight corrosion target detection network model specifically involves lightweight design of the corrosion target detection model from four aspects: lightweight network structure, attention module CBAM, feature pyramid structure, and improved model, so that the algorithm model meets the needs of mobile terminal use.
[0012] The specific steps of deploying the rust target detection algorithm in the automatic recognition system are as follows: In order to enable the YOLOv5-based model to complete the reasoning operation in the HiSilicon chip, the model needs to be converted into a Caffe model structure suitable for the NNIE environment through relevant tools, and the converted wk file is transplanted to the development board. The specific steps of model conversion are as follows: Step 1: Convert the training weight rustbest.pt to an onnx model: First, complete the pip-install of onnx, onnxruntime, tflite-support, x2paddle, coremltools, onnx-simplifier, and tensorflowj data packages in the envs environment of Anconda3, and then set the training image data size 512×512, the path of the weight best.py, the path of the training dataset, and the opset value to 9 in the export.py file; finally, after the parameters are set, use the command python . / export.py-weights . / best.pt --img512 --batch 1 --include=onnx to generate the rustbest.onnx file in the folder where rustbest.pt is located, and use the onnx-simplifier toolkit to simplify the onnx file to generate the rust_yolov5.onnx file; Step 2: Convert onnx model to caffe: First, complete the installation and environment configuration of the tools yolov5_caffe and yolov5_onnx2caffe, then run yolov5_caffe / python and modify the convertCaffe.py file; run the modified convertCaffe.py script to generate the rust_yolov5.caffemodel file; Step 3: Convert the caffe model to the wk model: First, delete the Transpose layer in the rust_yolov5.prototxt file and change the first layer dim in the Reshape layer from 1 to 0; Find RuyiStudio-2.0.38 under the nine file in HiSVP_PC_V1.2.2.0, add the rust image to the image, and put the caffemodel and prototxt files in the model; After adding the prototxt and caffemodel file paths in the interface, start running to generate the wk model; Step 4: Transplant the wk model to the Hi3519A development board: First, modify the makefile file in the yolov5 directory of the SDK and execute it with make. Use arm-hisiv200-linux-gcc / ld to complete the dynamic compilation and linking of the yolov5 model file, the file is rust.so; then use the cross-compilation tool chain to execute the make command to compile sample_venc with the dynamically linked header file and the public header file of the HiSilicon chip, and burn the generated sample_venc, rust.so, and wk models to the ko directory of the development board through tftpd32.exe.
[0013] The present invention has the following beneficial effects: 1. Study the design of real-time monitoring devices. Determine the design of the monitoring system with Hi3519A as the core processor, and plan the basic hardware framework and system software structure design of the monitoring device. Complete the construction of the Hi3519A development environment and the burning of related drivers, laying the foundation for the subsequent design of the rust area detection model and the construction of the embedded monitoring system.
[0014] 2. Two models for rust area detection, YOLOv5m-ODPS and lightweight rust target detection model YOLOv5-CGCB, were designed. First, the creation of the data set and the selection of network parameters were completed, and then improvements were made based on YOLOv5m to obtain YOLOv5m-ODPS. Through this improvement, the accuracy and recall rate of rust detection have been significantly improved. In terms of the mean average precision mAP0.5 evaluation index, YOLOv5m is 81.5, and YOLOv5m-ODPS is 90.7. The improved model is 10.1% higher than the original model, and the detection function of rust targets has been preliminarily realized. Subsequently, the lightweight model YOLOv5-CGCB was further designed based on YOLOv5m-ODPS, aiming to reduce the model size, reduce the calculation parameters, and ensure accuracy at the same time. The volume, network parameters, mAP0.5 and FPS of YOLOv5m-ODPS are 50.30, 45.6, 90.7 and 71.9 respectively, and the volume, network parameters, mAP0.5 and FPS of YOLOv5-CGCB are 3.78, 4.1, 88.0 and 265 respectively. The volume and network parameters of this model are almost 1 / 12 and 1 / 11 of those of the YOLOv5m-ODPS model. The average precision is reduced by 2.7% compared with the former, and the FPS is nearly 3 times the original.
[0015] 3. Built an embedded monitoring system for corroded area image acquisition, and successfully realized the functions of corroded area detection and real-time transmission of images. Completed the construction of the basic hardware framework of the monitoring system with Hi3519A as the core processor and the design of the system software structure. Deployed the designed detection algorithm to the image acquisition device, tested the system environment, communication connection, wireless transmission display and playback, and corroded target detection functions, and verified the practicality of the wireless acquisition system. The effect diagram is shown below. Fig.13 As shown in the figure, the system is tested from four aspects: the vertical placement detection result with a spacing of 2m, the horizontal placement detection result with a spacing of 2m, the multi-target detection effect with a spacing of 2m, and the detection effect of two rusted steel plates near and far. Fig.13 It can be seen that the embedded monitoring system has no false detection and no missed detection, and performs excellently.
[0016] In summary, the present invention is based on an embedded monitoring system of the Hi3519A core processor, combined with a rust area detection model and a lightweight rust target detection model, to construct a set of methods for rust area detection and real-time image transmission to the PC side, that is, to identify the rust area on the surface of hydraulic machinery and equipment in real time through an image acquisition device, and to transmit the image to the PC side in real time for display through wireless transmission. Thus, an integrated method for identifying rust on the surface of hydraulic machinery and transmitting detection images in real time is formed, including the steps of building a development environment and burning drivers, designing a rust area detection model algorithm, and building an embedded monitoring system. A series of performance test results show that this method can achieve accurate rust area detection on a mobile device, avoiding the problems of strong subjectivity and low reliability of traditional manual handheld device detection methods, and provides new ideas and methods for detecting rust areas on the surface of hydraulic machinery and equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0018] Figure 1 It is the overall flow chart of the design of the metal corrosion area detection system on the surface of hydraulic machinery and equipment of the present invention.
[0019] Figure 2 It is an image target detection process diagram of the YOLO target detection algorithm in the present invention.
[0020] Figure 3 It is a structural diagram of the YOLOv5 model in the present invention.
[0021] Figure 4 This is the network structure diagram based on the improved YOLOv5m in the present invention.
[0022] Figure 5 This is a display diagram of some data sets in the present invention.
[0023] Figure 6 It is an image enhancement effect diagram in the present invention.
[0024] Figure 7 It is a diagram of the marking method in the present invention.
[0025] Figure 8 It is a diagram of the dynamic optimization detailed parameters S1 in the present invention.
[0026] Fig. 9 It is the model training result after parameter optimization in the present invention.
[0027] Fig.10 It is a structural diagram of the lightweight model in the present invention.
[0028] Fig.11 This is a print interface diagram of the HiLinux system of the development board in the present invention.
[0029] Fig.12 This is a ping command test diagram in the present invention.
[0030] Fig.13 It is a display diagram of the corrosion detection effect of the surface corrosion detection system of hydraulic machinery and equipment in the present invention. DETAILED DESCRIPTION
[0031] The embodiments of the present invention are further described below in conjunction with the accompanying drawings.
[0032] Embodiment 1: An automatic identification system for rusted areas on the surface of hydraulic machinery and equipment, with the following functions: Realize the PC end to receive wireless real-time monitoring images: meet the real-time transmission detection image requirements; The system can realize HDMI real-time playback: high-definition real-time monitoring screen display; Realize rapid detection of rusted areas: quickly identify rusted areas and add identification frames; Image processing related functions: The device computing power supports real-time detection and image compression processing related algorithms.
[0033] The overall design flow chart of the present invention is as follows: Figure 1 shown.
[0034] The basic components of the embedded front-end acquisition system are Figure 1 As shown in the development board, it includes: Image sensor: IMX334 image sensor is selected, which has the characteristics of high sensitivity and low power consumption; Storage module: LPDDR4 and eMMC5.1 chips are selected to improve performance and reliability, achieve low power consumption and high data transmission rate, and ensure data reliability and integrity; Serial port module: The serial port is a serial communication interface based on the RS232 transmission protocol, which is used for device data transmission. When the PC is debugging an embedded device, a USB adapter can be used instead of the serial port to complete the communication with the PC; Ethernet module: The Ethernet module transmits image data to the back-end device through a Gigabit interface. GMAC is responsible for managing data transmission tasks and ensuring data integrity. Clock and reset circuit: The clock circuit provides the system timing signal, including the crystal oscillator and RTC circuit. The reset circuit ensures that the system returns to the initial state at startup or under abnormal conditions, ensuring system stability and normal operation; Power module: The hardware circuit includes multiple voltage outputs: 12V main power, 5V video encoding / USB, 3.3V serial port, 1.1V LPDDR4, 1.8V eMMC5.1 / PHY, 0.8V core; Video input module: In the Hi3519AV100 chip, the VI module is responsible for receiving the video signal collected by IMX334 and converting it into digital video data, and optimizing the image quality through ISP processing; Video processing module: VPSS is the video processing core of HiSilicon chips. It completes image enhancement, denoising, resolution conversion and other processing through multi-channel collaboration to improve video processing performance. Video encoding module: VENC is responsible for compressing and encoding video image data, including image input, encoding processing and bitstream output. It improves encoding quality through advanced algorithms and realizes data storage and transmission.
[0035] Among them, the rust area recognition system includes two parts: automatic rust recognition and real-time transmission of detection images. The specific steps are as follows: Step 1: Build the underlying software of the system: In the development process of embedded devices, the Linux system is implanted through the collaborative work of the PC, Hi3519AV100 development board and Linux server. The specific steps for building the underlying software are as follows: Step 1-1: Configure the virtual environment on the PC: First, complete the installation of VMware and Ubuntu system on the PC, enter Terminal, set the interpreter of the virtual machine to bash through the command "sudodpkg-reconfigure dash", and then complete the root password setting through "sudo passwdroot", then complete the network configuration of NAT mode in VMware, and add common tools such as cmake, git, X86, and u-boot through "sudo apt-getinstall". Finally, complete the construction of the NFS server. The NFS loading command is "sudo apt-get install nfs-kernel-server", and enter "sudogedit / etc / exports" to configure NFS. At the end of Terminal, you need to add the command " / home / nfs / *(rw,sync,no_root_sqiash)", and complete the final NFS restart with " / etc / init.d / nfs-kernel-server restart". At this point, the construction of the NFS server has been completed.
[0036] Step 1-2: Migration of HiSilicon cross-compilation tools: First, copy the arm-himix200-linux file provided by HiSilicon to the Ubuntu desktop of the virtual machine, and complete the installation of the compiler using the following instructions; tar zxvf arm-himix200-linux.tgz-C; cd arm-himix200-linux; chmod +x arm-himix200-linux.install; sudo . / arm-himix200-linux.install; Then add the SDK file Hi3519AV100_SDK_V2.0.2.0 to the Ubuntu system, use the command tarzxvf Hi3519AV100_SDK_V2.0.2.0.tgz to decompress the compressed package, guide Terminal to access the path cdHi3519AV100_SDK_V2.0.2.0, and finally expand the SDK compilation tool through . / sdk.unpack.
[0037] Step 1-3: Production of U-Boot image file and core Linux: Different from the PC side, the embedded development board of Hi3519AV100 starts the system core and boots the loading of the Bootloader program through the U-Boot image file. The current system version used by Hi3519AV100 is Linux-4.9.37, and the storage path of the Linux system file is Hi3519AV100_SDK_V2.0.2.0 / osdrv / opensource / kenel / .
[0038] cp configs / Hi3519AV100_defconfig.config; make ARCH=arm CROSS_COMPILE=arm-himix200-linux-menuconfig; make ARCH=arm CROSS_COMPILE=arm-himix200-linux; cp .. / .. / .. / tool / pc / uboot_tools / reg_info.bin.reg; make ARCH=arm CROSS_COMPILE=arm-himix200-linux-u-boot-z.bin; Use the above instructions to copy Hi3519AV100_defconfig.config to the kernel and generate the U-Boot image bin file of the Hi3519AV100 development board. Then use the following instructions to get the system kernel image file ulmage.
[0039] cp arch / arm / configs / Hi3519AV100_smp_defconfig.config; make ARCH=arm CROSS_COMPILE=arm-himix200-linux-menuconfig; make ARCH=arm CROSS_COMPILE=arm-himix200-linux-ulmage; Step 1-4: Create and burn the root file system In SDK, select rootfs_Hi3519ac100_64k.jffs2 as rootfs. After selecting the official file, no root file system is created. The path to save the rootfs file is Hi3519AV100_SDK_V2.0.2.0 / smp_image_glibe / . Transfer the above three files ulmage, rootfs, and bin to SPI Flash, and the bin file is burned by HiSilicon HiTool. After setting the local PC configuration and board IP configuration in ulmage and rootfs image files, select the partition table file, save it, and click Start Burning.
[0040] Step 1-5: Burn the WIFI driver: First, transfer the wireless network card driver file to the Linux virtual machine to complete the decompression task, then modify the config.mk file, and convert the driver mode from PC to ARM by setting the CONFIG_PLATFORM_I386_PC value to n and the CONFIG_PLATFORM_ARM_S3 value to y. Then set the installation path to Hi3519AV100_SDK_V2.0.2.0 / osdrv / opensource / keenel / and execute the command make. Finally, the .ko driver file is burned to the development board through the HiTool tool and the network configuration is completed.
[0041] Step 1-6: Burn the driver of IMX334 First, copy the downloaded IMX334 driver file to the file path smp_bk / a53_linux / mpp / component / isp / user / Sensor / Hi3519av100 / and decompress and install it, then complete the compilation operation through the command make.
[0042] Step 2: Communication connection: The video image data of the wireless acquisition device is transmitted to the back-end PC through TCP and UDP protocols. TCP provides reliable, connection-oriented data transmission, which is suitable for applications with high requirements for data integrity; UDP provides simple and efficient connectionless data transmission, which is suitable for applications with high requirements for real-time performance. Combined with RTSP and RTP protocols, TCP controls the signal flow, UDP transmits the video data stream, and combines with RTCP protocol to improve the quality of video images at the data receiving end. The specific implementation includes three parts: RTSP server construction, listening port setting, and data transmission. Functions are used to initialize parameters and establish TCP connections, create threads to process request signals, and functions are used to pass data information to achieve data interaction between the device and the PC.
[0043] Step 3: Design of YOLO target detection algorithm: Object detection is an important image analysis task in deep learning, including object recognition and positioning. The overall process is as follows: Figure 2 YOLOv5 is an open source project based on Pytorch released in 2020. It has real-time and multi-category detection capabilities and is widely used in fields such as autonomous driving and video surveillance. Its structure is shown in the figure below. Figure 3 As shown in the figure, the YOLOv5 network structure includes six modules: full-dimensional dynamic convolution, polarization self-attention module, pooling structure SimSPPF, bounding box regression loss function, surface corrosion target detection model of hydraulic machinery and equipment, and preparation and training of data sets. The target detection model is defined and improved through these six modules.
[0044] Module 1, full-dimensional dynamic convolution: Compared with traditional convolution, full-dimensional dynamic convolution (ODConv) captures feature relationships comprehensively by adding multi-dimensional attention mechanisms in parallel, enabling the model to adaptively learn the correlations of each dimension without adding parameters and computational costs. This method improves model performance while maintaining high computational efficiency and accuracy. The expression of ODConv is: ; In the formula, They are convolution kernels , the attention weights of kernel space dimension, input channel dimension, and output channel dimension, is a point multiplication operation. ODConv uses four different attention and convolution kernels Multiply and accumulate to obtain input features Compared with traditional multi-layer stacked convolution, ODConv improves the feature capture capability while greatly reducing network calculation parameters for information in different dimensions.
[0045] Module 2, Polarized Self-Attention Module: Polarized Self-Attention (PSA) is used in the Backbone part of the YOLO model to quickly locate and accurately extract key corrosion features in the input image. PSA has multiple advantages over other attention mechanisms: adapting to multi-scale information processing, enhancing the ability to analyze objects of different scales, decomposing color channels and spatial position features, flexibly adjusting attention weights, and enhancing model depth. These features enable the model to better understand object features, improve classification accuracy, and effectively match actual targets, showing good adaptability and performance improvement.
[0046] The channel attention branch expression is: ; The spatial attention branch expression is: ; The overall implementation expression of PSA is: ; In the formula, it is assumed that the input feature matrix is The output is , Reshape operation. represents global average pooling, It is a matrix dot product. The final result is output after fusing the feature maps obtained in the channel and spatial dimensions.
[0047] Module 3, pooling structure SimSPPF: SPP is a pooling operation that fuses feature maps of different scales into a feature vector of fixed size, realizing multi-scale information fusion, which helps the model understand the local features and overall structure of the object. SPPF is an extension of SPP, using a serial structure to improve computational efficiency. SimSPPF introduces a similarity pooling method, which captures multi-scale information through regional similarity, processes objects of different scales more effectively, improves forward reasoning efficiency, and reduces computational complexity.
[0048] Module 4, Bounding Box Regression Loss Function: Bounding box regression loss function is crucial in target detection. It optimizes model parameters to improve positioning and classification accuracy, enhance generalization ability and robustness. Minimizing the loss function reduces the difference between the prediction and the true label, and improves the accuracy of target location and category prediction. Correctly selecting and designing a loss function suitable for the task is crucial to the performance and effect of the algorithm. YOLOv5 target detection model uses CIoU regression loss function , which is defined as: ; ; ; In the formula, Represents the center coordinates of the label box and the width and height of its box. Represents the model's predicted center point coordinates and the width and height of its box, Represents the width and height of the minimum union area of the label box and the prediction box.
[0049] In addition to CIoU, there are many other loss functions based on addition, such as GIoU, DIoU, and EIoU, but they do not consider the aspect ratio and shape differences of the target box, resulting in low accuracy of the model when matching targets with large aspect ratio and shape differences, and increased training difficulty. Therefore, the SIoU loss function that considers aspect ratio and shape is introduced to replace CIoU, reducing training difficulty and improving training efficiency and detection accuracy.
[0050] In the formula, it is assumed that the angle Connect the center points of the label box and the prediction box The minimum angle between the axes is defined by: ; When the line connecting the center points is parallel to any coordinate system axis, ; When the angle between the center line and any coordinate axis is hour, The distance between the center points of the two frames is , the formula is defined as: ; Assume that the difference in shape between the two boxes is , the formula is defined as: ; Finally, based on the above, the loss function is defined as: ; Module 5, model for detecting rusted targets on the surface of hydraulic machinery and equipment: To solve the problems of false detection, missed detection and low precision in rusted target detection, the YOLOv5m network is improved. First, the full-dimensional dynamic convolution ODConv is used to replace the traditional convolution to improve the feature expression ability; secondly, the Polarized Self-Attention mechanism is introduced in Backbone's C3 to enhance the recognition ability of rusted targets; then, SimSPPF is used to replace the SPPF structure to expand the receptive field while reducing the number of parameters; finally, the SIoU bounding box loss function is used to improve the model training convergence speed and detection performance. Combining these improvements, a new rusted target detection algorithm YOLOv5m-ODPS is proposed, and its network structure diagram is shown below. Figure 4 shown.
[0051] Module 6, Dataset preparation and training: This target detection algorithm was experimentally verified under Windows 10 64-bit operating system using Pytorch1.8.2 +cu111 deep learning framework, Python programming language, Cuda version 11.1, and Cudnn version 8.0.5. The hardware configuration is i5-13600KF (3.5GHz) CPU, NVIDIA GeForce RTX 4070ti 12GB video memory, and 32GB running memory. In order to construct a rust recognition dataset, metal structure rust images were collected from the Internet and literature, and labeled images were produced. A total of 630 high-quality metal surface rust images were screened out, with unified sizes of 256×256, 512×512, and 1024×1024, and divided into training sets (512 images), validation sets (64 images), and test sets (64 images). Some of the dataset images are shown below. Figure 5 To avoid overfitting, the dataset was enhanced offline, including rotation, flipping, resizing, brightness adjustment, Gaussian blurring, etc., and expanded to 6,300 images. Some of the enhanced images are shown below. Figure 6 After image preprocessing and data set construction, the rusted areas in 6,300 metal surface rusted images were manually annotated using software. For complex environments and those containing foreign matter, a large range of rusted areas were repeatedly annotated to enhance the deep learning network’s ability to learn rust features. The annotation method is as follows: Figure 7 As shown in (b), the corresponding label file is generated, which provides accurate supervision information for the subsequent training of the rust area target detection model.
[0052] In order to objectively evaluate the performance of the target detection algorithm, the accuracy , recall rate , mean average precision , Storage space occupied , Detection speed The superiority of the algorithm is measured by other indicators. The expression is as follows: ; ; ; In the formula, is the number of actual rust targets correctly identified; is the number of actually corroded objects that were mistakenly identified as non-corroded; The number of non-corroded objects identified as corroded objects; is the category of defect detection; is the detection accuracy corresponding to each category.
[0053] In order to adapt to the complex open-air corrosion detection environment, this algorithm optimizes the network model hyperparameters. Some hyperparameters obtained by training the basic model are adjusted to make it more suitable for the corrosion data set. The cosine annealing learning rate optimization method is used to dynamically adjust the learning rate to optimize the model learning process. This method uses different learning rates in different training stages. The larger learning rate in the initial stage gradually decreases to the minimum value, and the subsequent training gradually increases to the initial learning rate. This learning rate change mode cooperates with the model training parameters to effectively improve the model performance, which is expressed as: ; In the formula, is the round of current model training. Represent the maximum learning rate and the minimum learning rate respectively, Indicates the number of rounds that the current training has completed. Representation model training The total number of training sessions in the round.
[0054] according to Figure 8 The network parameter S1 obtained by hyp.scratch-med training is adjusted by the new network structure parameter S1. Fig. 9 In (a), the number of training rounds for the subsequent model was reduced from 300 to 100, which enabled the model to converge in a shorter time and shortened the training time to 1 / 3 of the original time, effectively improving the model training efficiency. The parameter R decreased by 5.4%, while the parameters P and mAP0.5 increased by 3.6% and 2.3% respectively. Fig. 9 (b) shows the P, R, mAP0.5 and mAP0.95 curves of model training, indicating that the learning performance and effect of the network model have been improved.
[0055] Step 4: Lightweight design: Compared with YOLOv6 and YOLOv7, YOLOv5 requires fewer parameters in image reasoning and target detection, has more efficient calculations, a more flexible structure and better performance, and is suitable for real-time detection of remote devices. However, mobile acquisition devices usually have limited computing power, making it difficult to deploy and run deep learning networks. To this end, this step will lightweight the rust target detection model from four aspects: lightweight network structure, attention module CBAM, feature pyramid structure, and improved model, so that the algorithm model meets the needs of mobile terminal use.
[0056] Lightweight network structure: The lightweight neural network model GhostNet proposes the Ghost module to reduce parameters and computation, maintaining high accuracy while improving inference speed. GhostNetV2 is an efficient neural network model that introduces Ghost Bottleneck and Ghost Group modules based on GhostNet. Ghost Bottleneck reduces the number of network parameters through low-rank convolution kernels and feature reuse, and DFC extracts global context information. The Ghost Bottleneck result is obtained by multiplying the feature matrix output by Ghost and DFC, realizing the interaction and information transmission of long-distance features and enhancing global perception capabilities. GhostNetV2 selects different structures depending on the value of Stride.
[0057] Attention module CBAM: In the YOLOv5 network, the Neck structure is a key part of feature processing. It is located between the backbone network and the output layer and plays the role of integrating features. By introducing CBAM in the Neck part, the model enhances the ability to capture and learn important features without changing the depth and width, thereby improving detection performance. CBAM is a lightweight attention module that highlights important features and reduces the influence of secondary features by adjusting feature weights. In small target detection, CBAM can accurately capture location information and suppress irrelevant information, thereby improving detection accuracy. In YOLOv5, each C3 module adds a CBAM to strengthen the model's learning of key features and improve its ability to accurately locate targets.
[0058] Feature pyramid structure: The FPN structure is used in YOLOv3 of the YOLO feature extraction network. The FPN structure achieves multi-scale feature fusion through top-down and lateral connections, but the calculation and parameter requirements are large, and there are problems such as small targets are easily masked by large target information and cannot be detected, and the unique identification features of rust in complex environments cannot be detected. To this end, the bidirectional feature pyramid network BiFPN-Concat is used as the multi-scale feature extraction network of the improved model, and the PAN in the original YOLOv5s is replaced with BiFPN-Concat. The PAN structure has better multi-scale feature fusion and feature transfer than FPN, but it increases the complexity and computational burden. In order to solve the challenges in rust detection, BiFPN-Concat is used to replace PAN. The overall structure is more complex, with advantages such as bidirectional feature propagation, multi-level fusion and dynamic feature weight adjustment, which improves the detection accuracy and stability of the model for targets of different scales, can better capture the unique characteristics of rust, and improve detection accuracy.
[0059] Improved model: A lightweight model is designed for the rust area detection task. Fig.10 As shown in the figure. Based on the GhostNetV2 structure, the attention mechanism of the backbone network and the CBAM module in Neck are optimized, feature fusion and semantic information are strengthened, and the ability to detect small targets is improved. Combining BiFPN-Concat and SIoU bounding box regression loss functions, accurate detection of small targets is achieved while reducing the computational burden, providing a basis for fast and accurate detection of rusted areas.
[0060] Step 5: Convert rustbest.pt to onnx model: Install onnx, onnxruntime, tflite-support, x2paddle, coremltools, onnx-simplifier, and tensorflowjs packages in the envs environment of Anaconda3. Set the image data size to 512×512, the weight path to best.pt, the path of the training dataset, and the opset value to 9 in the export.py file. Then, run "python . / export.py --weights . / best.pt --img 512 --batch 1 --include=onnx" in the command line to generate the rustbest.onnx file in the folder where rustbest.pt is located, and use the onnx-simplifier toolkit to simplify the process and generate the rust_yolov5.onnx file.
[0061] Step 6: Convert the onnx model to the caff model: First, you need to complete the installation and environment configuration of the tools yolov5_caffe and yolov5_onnx2caffe, then run yolov5_caffe / python and modify the convertCaffe.py file. Run the modified convertCaffe.py script to generate the rust_yolov5.caffemodel file.
[0062] Step 7: Convert the caffe model to the wk model: First, you need to edit the rust_yolov5.prototxt file and delete the Transpose layer. Next, adjust the dim parameter of the first layer in the Reshape layer from 1 to 0. In the nine folder of HiSVP_PC_V1.2.2.0, find RuyiStudio-2.0.38. In the image folder, add the rust image; in the model folder, put the caffemodel file and the prototxt file. After completing these steps. After adding the prototxt and caffemodel file paths in the interface, generate the wk model.
[0063] Step 8: Port the model to the development board: First, you need to modify the makefile file in the yolov5 directory in the SDK and execute the make command. Use the arm-hisiv200-linux-gcc / ld tool chain to complete the dynamic compilation and linking of the yolov5 model file and generate a file named rust.so. Next, use the cross-compilation tool chain to compile the dynamically linked header files and the public header files of the HiSilicon chip, and execute the make command to compile sample_venc. Finally, burn the generated sample_venc file, rust.so file, and wk model to the ko directory of the development board through the tftpd32.exe tool.
[0064] Step 9: System transplantation related tests: Hi3519A has completed the Linux system porting work. After the development board is rebooted, the system print information can be seen by opening the serial port with Xshell software, such as Fig.11 As shown, it shows that the HiLinux system is implanted successfully.
[0065] Step 10: Wireless communication function test: After completing the installation and configuration of the WIFI driver for the Hi3519A development board, use the ping command to test its connection with the PC server. The result is as follows: Fig.12 As shown in the results, the network connection between the Hi3519A development board and the Linux server on the PC has been completed, and the transmission of video image data can be achieved.
[0066] Step 11: Wireless transmission display and detection function test: To observe the transmission quality, the RTSP data packet transmitted by the wireless acquisition system is captured through the media player VLC on the PC. First, connect the USB to TTL serial port to the laptop PC, open the serial port com4 with Xshell, and complete the mounting of the development board and the virtual server through the commands ifconfig eth0up, ifconfig eth0 192.168.85.20, and mount -o nolock 192.168.85.200: / home / xstrive / hisi / mnt / . Then, enter the venc directory, use the command cd / mnt / Hi3519AV100_SDK_2.02.0 / smp / a53_linux / mpp / sample / venc, and finally enter the image sensor start command . / sample_venc 0, and select 0 and C in turn. The laptop and the development board are linked with RTSP, and the rust target detection effect is as follows Fig.13 As shown, the effectiveness of the real-time monitoring system designed by the present invention is verified.
[0067] Step 12: System delay test: The system delay of the device studied in this invention includes two parts: detection and transmission. Detection delay refers to the time from the appearance of the rust target to the detection by the system algorithm of the monitoring device, while transmission delay refers to the total time required for data encoding transmission and display and playback on the PC. In laboratory tests, the detection time was recorded using a timer in a laptop computer. The results showed that as the distance between the rust object and the device increased, the delay time also increased accordingly. In terms of transmission, the transmission performance was statistically analyzed through the media information of the VLC player. The results showed that the average number of frames received for video data was 28.24 frames / second, the packet loss rate did not exceed 6%, and the video playback was smooth, meeting the expected requirements. In summary, the experimental results show that the system performs well in monitoring and transmission, providing reliability support for real-time monitoring.
[0068] Among them, steps 1 to 3 complete the construction of the development environment, burning of related drivers, and preparation work before the development of Hi3519A on the bare board of HiSilicon Hi3519A; steps 4 to 5 design a detection model for rusted areas and a lightweight rusted target detection model; steps 6 to 9 complete the deployment of the rust detection algorithm on the system, so that the YOLOv5-based model can complete the reasoning operation on the HiSilicon chip; steps 10 to 13 complete the functional test and result analysis. In this way, the automatic recognition of surface rust of hydraulic machinery and equipment and the real-time transmission of detection images are completed.
[0069] At this point, the selection of software and hardware for the image acquisition device and the preliminary preparation work have been completed, the design of the automatic identification algorithm for metal surface corrosion of hydraulic structures, the realization of the real-time transmission function of corrosion images and the entire process of result testing have been completed.
[0070] Embodiment 2: The overall design of the present invention is as follows Figure 1 As shown in the figure, it is mainly divided into three parts. The first part is the overall construction of the front-end acquisition system hardware and the software implantation, the second part is the design of the corrosion detection model algorithm, and the third part is to deploy the designed algorithm to the embedded device, and then verify whether the embedded device meets the requirements of actual engineering through a series of tests.
[0071] The hardware of the front-end acquisition system of the embedded device is integrated on a PCB board, including processor chip, image sensor, storage module, power module, Ethernet module, etc. Processor chip: The core processor needs to have a built-in NPU neural network processing unit to support the installation and operation of the deep neural network model framework, and can complete the target detection task with this as the core. In order to meet the needs, the Hi3519AV100 processor is selected as the core processor; Image sensor: The wireless acquisition device needs to have the characteristics of stable structure, small size, low power consumption, fast image reading speed and low cost. Therefore, the CMOS-based IMX334 is selected. Image sensor; Storage module: According to the performance requirements of the wireless acquisition device, the LPDDR4 chip MT53E512M32 is selected for RAM to provide higher output transmission power at low power consumption, and the Samsung KLMBG2JETD chip is selected for Flash. With its low-temperature structural design and reliable flash memory controller, the chip can withstand frequent read and write operations, and the reliability and integrity of the data are guaranteed; Serial port module: It is based on the RS232 transmission protocol and is used for serial communication between devices. During the debugging process, a USB converter is used instead of UART to complete the communication between the embedded device and the PC; Clock and reset circuit: The clock circuit provides the embedded device with a working timing signal so that the system can work according to the established frequency and timing, and the reset circuit ensures that the system can be restored to the initial state under abnormal circumstances; Ethernet module: The image data information processed and encoded by the wireless acquisition device is transmitted to the PC using the RTSP communication protocol using the Gigabit network port to complete the network connection and data transmission between the wireless acquisition device and the PC. For this purpose, RGMII 1000 is selected Mbit / s to complete the construction of the Ethernet module; power module: in the hardware circuit of the processor chip, the circuit voltage includes 12 V of the main input power supply, 5 V of I / O of the video encoding module and USB port, 3.3 V of the serial port voltage, 1.1 V of the LPDDR4 interface, 1.8 V of the power supply voltage of eMMC5.1 and PHY, and 0.8 V of the chip core voltage; finally, the design of the basic video image processing and data transmission related functions of the wireless acquisition system is completed.
[0072] Furthermore, the underlying software configuration covers the development environment construction of the embedded board and the PC and the burning of the basic operating system. First, the PC installs the Linux operating system through the VMware virtual machine, connects the virtual machine to the Internet, completes the network configuration and completes the setting of the code text compiler Bash; then, by building a TFTP file transfer server to achieve connection communication and data transmission between Linux and the development board, build an NFS server to ensure the sharing and management of the development board files and the Linux system; then, install the SDK so that the development board can run scripts in a bare metal environment, obtain the kernel image file and port it to the development board; finally, burn the drivers of the WIFI and IMX334 sensors to the development board.
[0073] Furthermore, in order to collect image information of the rusted area, a rusted area detection model and a lightweight rusted target detection model are designed. The network structure is as follows: Figure 4 and Fig.10 As shown. First, the detection model is defined and improved in five aspects: dynamic convolution, polarization self-attention module, pooling structure, bounding box regression loss function, and surface corrosion target detection model of hydraulic machinery and equipment; then, the production of the data set and the selection of network parameters are explained, and the designed detection model is trained to obtain a significantly improved performance of the improved model compared with the original model; finally, with the purpose of reducing the model size, reducing the calculation accuracy, and ensuring the detection accuracy, a lightweight model is designed so that the model can meet the target corrosion detection requirements and improve the feasibility of the model deployment on low-computing-power, low-power embedded devices.
[0074] Furthermore, the detection algorithm designed by the present invention is deployed on the wireless acquisition system; then, the connection between the corrosion image acquisition device and the PC is completed, and the RTSP data is captured by VLC on the PC to display the real-time detection screen transmitted by the image acquisition device; finally, the system environment, communication link, wireless transmission display playback and corrosion target detection functions of the corrosion image acquisition device are tested, such as Fig.13 As shown in the figure, the test results prove the success of the real-time detection of rusted targets by the wireless acquisition system. The maximum transmission delay is less than 1s, the video transmission frame rate is 28.24FPS, and the video playback is smooth, which verifies the effectiveness of the wireless acquisition device.
[0075] Embodiment 3: The method for automatically identifying surface corrosion of hydraulic machinery and equipment and transmitting detection images in real time comprises the following steps: Step 1: Build the underlying system software: Due to limited hardware resources, in order to complete the implantation of the Linux system, the PC, development board, and Linux server need to work together. The specific steps for building the underlying software are as follows: Step 1-1: Configure the virtual environment on the PC: Install VMware and Ubuntu system on the PC, set the interpreter to bash, configure the network to NAT mode, install common tools, build the NFS server and restart after configuration.
[0076] Step 1-2: Migration of HiSilicon cross-compilation tools: Copy the arm-himix200-linux file provided by HiSilicon to the Ubuntu desktop, install the compiler and decompress the SDK file Hi3519AV100_SDK_V2.0.2.0, and run sdk.unpack to expand the compilation tool.
[0077] Step 1-3: Production of U-Boot image file and core Linux: Hi3519AV100 embedded development board uses U-Boot image file to start the system and load Bootloader program. Copy the configuration file to the kernel through instructions, generate U-Boot image bin file, and then generate system kernel image file ulmage.
[0078] Step 1-4: Create and burn the root file system: Select rootfs_Hi3519ac100_64k.jffs2 as rootfs in SDK, no need to create root file system. Transfer ulmage, rootfs, and bin files to SPI Flash, and use HiSilicon HiTool to burn. After completion, implant image sensor and WIFI drivers.
[0079] Step 1-5: Burn the WIFI driver: Unzip the wireless network card driver file to the Linux virtual machine, modify the configuration file to convert the driver mode to ARM, set the installation path and compile. Use the HiTool tool to burn the .ko driver file to the development board to complete the network configuration.
[0080] Step 1-6: Burn the driver of IMX334: Copy the downloaded IMX334 driver file to the specified path, decompress and install it, and compile it using the make command.
[0081] Step 2: Communication connection: The video data of the wireless acquisition device is transmitted to the back-end PC through TCP and UDP protocols. TCP ensures data integrity and is suitable for high-demand applications; UDP provides efficient real-time transmission and is suitable for applications with high real-time requirements. Combined with RTSP, RTP and RTCP protocols, TCP controls the signal flow, UDP transmits the video data flow, and RTCP improves the video quality of the receiving end. The implementation includes RTSP server construction, listening port setting, data transmission, and initialization of parameters through functions, establishment of TCP connection, and creation of threads to process request signals to achieve data interaction between the device and the PC.
[0082] Step 3: Design of YOLO target detection algorithm: Target detection includes target recognition and positioning. YOLOv5 has real-time and multi-category detection capabilities. The YOLOv5 algorithm includes five modules: full-dimensional dynamic convolution, polarization self-attention module, pooling structure SimSPPF, bounding box regression loss function, and surface corrosion target detection model of hydraulic machinery. The design of the YOLOv5 algorithm is completed through the preparation and training of the data set.
[0083] Step 4: Lightweight design: YOLOv5 requires few parameters in image reasoning and target detection, has efficient calculation, flexible structure and good performance, and is suitable for real-time detection of remote devices. However, mobile image acquisition devices usually have limited computing power, making it difficult to deploy and run deep learning networks. To this end, this step will lightweight the target detection model from four aspects: lightweight network structure, attention module CBAM, feature pyramid structure, and improved model, so that the algorithm model meets the needs of mobile terminal use.
[0084] Step 5: Deploy the detection algorithm to the system: In order to enable the YOLOv5-based model to complete the inference operation in the HiSilicon chip, the model needs to be converted into a Caffe model structure suitable for the NNIE environment through relevant tools, and the converted wk file is transplanted to the development board. The specific steps of model conversion are as follows: Step 5-1: Convert training weights rustbest.pt to onnx model: Install the data package in the Anaconda3 environment, configure the export.py file, generate rustbest.onnx and simplify it to rust_yolov5.onnx. Run the export.py script by specifying parameters on the command line to complete the model export and simplification steps.
[0085] Step 5-2: Convert the onnx model to the caff model: First, you need to complete the installation and environment configuration of the tools yolov5_caffe and yolov5_onnx2caffe, then run yolov5_caffe / python and modify the convertCaffe.py file. Run the modified convertCaffe.py script to generate the rust_yolov5.caffemodel file.
[0086] Step 5-3: Convert the caffe model to the wk model: Edit the rust_yolov5.prototxt file, delete the Transpose layer and adjust the Reshape layer parameters. Put the rust image into the image folder of RuyiStudio-2.0.38 in the HiSVP_PC_V1.2.2.0 version, and generate the interface after putting in the model file. Generate the wk model after adding the file path and display the operation results.
[0087] Step 5-4: Port the model to the development board: Modify the makefile file in the YOLOv5 directory and execute the make command to generate the rust.so file. Use the arm-hisiv200-linux-gcc / ld tool chain to compile the model file, compile sample_venc and burn it to the development board.
[0088] Step 6: System Function Test: The system environment, communication link, wireless transmission display and playback, and detection functions of the corrosion target of the corrosion image acquisition device were tested to verify the feasibility and effectiveness of the system. The specific steps are as follows: Step 6-1: System transplantation related tests: After Hi3519A completes the Linux system transplantation, the development board reboots and the system print information can be seen by opening the string with Xshell software, indicating that the HiLinux system has been successfully implanted.
[0089] Step 6-2: Wireless communication function test: After completing the WiFi driver installation and settings of the Hi3519A development board, use the ping command to test its connection with the PC server. From the results, it can be seen that the network connection between the Hi3519A development board and the PC Linux server has been completed, and the transmission of video image data can be realized.
[0090] Step 6-3: Wireless transmission display and detection function test: Capture RTSP data packets through VLC to observe the transmission quality. Use Xshell on the PC to open the serial port com4, mount the development board and virtual server, then enter the venc directory and turn on the image sensor. Finally, connect to VLC on the laptop through RTSP to verify the effectiveness of the real-time monitoring system.
[0091] Step 6-4: System delay test: The device system delay includes detection and transmission. Detection delay is the time from the appearance of the target to the algorithm detection, and transmission delay is the time for data to be transmitted to the PC for display. Experiments show that the delay increases with the distance, and the transmission performance is good, with a frame rate of 28.24 frames per second, a packet loss rate of no more than 6%, smooth video, and excellent system performance.
Claims
1. An automatic identification system for the rusted area on the surface of hydraulic machinery and equipment. It is characterized in that It includes basic hardware and software systems; the basic hardware includes image sensor, storage module, serial port module, Ethernet module, clock and reset circuit, power module, video input module, video processing module and video encoding module; the software system includes system basic software and driver, communication connection and rust target detection algorithm; the system basic software and driver include: PC side configuration virtual environment, HiSilicon cross compilation tool transplantation, U-Boot image file and core Linux production, root file system production and file burning, WIFI driver burning and IMX334 driver burning; the rust target detection algorithm includes the design of YOLO target detection algorithm and the construction of lightweight rust target detection network model.
2. According to claim 1, a system for automatically identifying rusted areas on the surface of hydraulic machinery and equipment, Features: The image sensor is IMX334 image sensor; the storage module: LPDDR4 and eMMC5.1 chips are selected; Serial port module: The serial port is a serial communication interface based on the RS232 transmission protocol, which is used for device data transmission. When the PC is debugging an embedded device, a USB adapter can be used instead of the serial port to complete the communication with the PC; Ethernet network module: The Ethernet module transmits image data to the back-end device through the Gigabit interface. GMAC is responsible for managing data transmission tasks and ensuring data integrity; Clock and reset circuit: The clock circuit provides system timing signals, including crystal oscillators and RTC circuits. The reset circuit ensures that the system returns to the initial state at startup or under abnormal conditions, ensuring system stability and normal operation; Power supply module: The hardware circuit includes a variety of voltage outputs: 12V main power supply, 5V video encoding / USB, 3.3V serial port, 1.1V LPDDR4, 1.8V eMMC5.1 / PHY, 0.8V core; Video input module: In the Hi3519AV100 chip, the VI module is responsible for receiving the video signal collected by IMX334 and converting it into digital video data, and optimizing the image quality through ISP processing; Video processing module: VPSS, as the video processing core of HiSilicon chip, completes image enhancement, denoising, and resolution conversion processing through multi-channel collaborative work; Video encoding module: VENC is responsible for compressing and encoding video image data, including image input, encoding processing and bitstream output, improving encoding quality through advanced algorithms, and realizing data storage and transmission.
3. According to claim 1, a system for automatically identifying rusted areas on the surface of hydraulic machinery and equipment, Features: During the construction of the basic system software and drivers, the Linux system is implanted through the collaborative work of the PC, Hi3519AV100 development board and Linux server.
4. According to claim 3, a system for automatically identifying rusted areas on the surface of hydraulic machinery and equipment, Features: The specific steps for building the system software and driver are as follows: Step 1: Configure the virtual environment on the PC: Install VMware and Ubuntu systems on the PC, set the interpreter to bash, configure the network to NAT mode, install common tools git, X86, and u-boot, build an NFS server, and restart after configuration; Step 2: Copy the arm-himix200-linux file provided by HiSilicon to the Ubuntu desktop, install the compiler and decompress the SDK file Hi3519AV100_SDK_V2.0.2.0, and run sdk.unpack to expand the compilation tool; Step 3: U-Boot image file and kernel Linux production: Hi3519AV100 embedded development board uses U-Boot image file to start the system and load Bootloader program; copy the configuration file to the kernel through instructions, generate U-Boot image file, and then generate system kernel image file; Step 4: Make the root file system and burn the files: Select rootfs_Hi3519ac100_64k.jffs2 as the rootfs in the SDK, and there is no need to make the root file system; transfer the ulmage, rootfs, and bin files to the SPI Flash and burn them using the HiSilicon HiTool tool; after completion, implant the image sensor and WIFI driver; Step 5: Burn the WIFI driver: Unzip the wireless network card driver file to the Linux virtual machine, modify the configuration file to convert the driver mode to ARM, set the installation path and compile. Use the HiTool tool to burn the .ko driver file to the development board to complete the network configuration; Step 6: Burn the IMX334 driver: Copy the downloaded IMX334 driver file to the specified path and decompress and install it, and use the make command to compile it.
5. According to claim 1, a system for automatically identifying rusted areas on the surface of hydraulic machinery and equipment, Features: Specifically, the basic hardware transmits control signals and video data streams through TCP and UDP protocols. TCP ensures data integrity, UDP realizes real-time transmission, and combines RTSP and RTP protocols to realize real-time monitoring screen transmission. The RTCP and RTP protocols are combined to improve data quality feedback and control data packet transmission, so as to achieve real-time monitoring screen transmission between the device and the PC.
6. According to claim 1, a system for automatically identifying rusted areas on the surface of hydraulic machinery and equipment, Features: Specifically, the YOLO target detection algorithm includes six modules: a YOLOv5 network structure including full-dimensional dynamic convolution, a polarization self-attention module, a pooling structure SimSPPF, a bounding box regression loss function, a surface corrosion target detection model for hydraulic machinery and equipment, and preparation and training of a data set. The corrosion target detection model is defined and improved through these six modules, and the improved network parameters obtained through training have excellent performance.
7. According to claim 6, a system for automatically identifying rusted areas on the surface of hydraulic machinery and equipment, Features: The construction of a lightweight corrosion target detection network model specifically involves lightweight design of the corrosion target detection model from four aspects: lightweight network structure, attention module CBAM, feature pyramid structure, and improved model, so that the algorithm model meets the needs of mobile terminal use.
8. According to claim 7, a system for automatically identifying rusted areas on the surface of hydraulic machinery and equipment, Features: The specific steps of deploying the rust target detection algorithm in the automatic recognition system are as follows: In order to enable the YOLOv5-based model to complete the reasoning operation in the HiSilicon chip, the model needs to be converted into a Caffe model structure suitable for the NNIE environment through relevant tools, and the converted wk file is transplanted to the development board. The specific steps of model conversion are as follows: Step 1: Convert the training weight rustbest.pt to an onnx model: First, complete the pip-install of onnx, onnxruntime, tflite-support, x2paddle, coremltools, onnx-simplifier, and tensorflowj data packages in the envs environment of Anconda3, and then set the training image data size 512×512, the path of the weight best.py, the path of the training dataset, and the opset value to 9 in the export.py file; finally, after the parameters are set, use the command python . / export.py-weights . / best.pt --img512 --batch 1 --include=onnx to generate the rustbest.onnx file in the folder where rustbest.pt is located, and use the onnx-simplifier toolkit to simplify the onnx file to generate the rust_yolov5.onnx file; Step 2: Convert onnx model to caffe: First, complete the installation and environment configuration of the tools yolov5_caffe and yolov5_onnx2caffe, then run yolov5_caffe / python and modify the convertCaffe.py file; run the modified convertCaffe.py script to generate the rust_yolov5.caffemodel file; Step 3: Convert the caffe model to the wk model: First, delete the Transpose layer in the rust_yolov5.prototxt file and change the first layer dim in the Reshape layer from 1 to 0; Find RuyiStudio-2.0.38 under the nine file in HiSVP_PC_V1.2.2.0, add the rust image to the image, and put the caffemodel and prototxt files in the model; After adding the prototxt and caffemodel file paths in the interface, start running to generate the wk model; Step 4: Transplant the wk model to the Hi3519A development board: First, modify the makefile file in the yolov5 directory of the SDK and execute it with make. Use arm-hisiv200-linux-gcc / ld to complete the dynamic compilation and linking of the yolov5 model file, the file is rust.so; then use the cross-compilation tool chain to execute the make command to compile sample_venc with the dynamically linked header file and the public header file of the HiSilicon chip, and burn the generated sample_venc, rust.so, and wk models to the ko directory of the development board through tftpd32.exe.
