CN-116665143-B - Railway wagon image analysis method and device, electronic equipment and storage medium
Abstract
The invention relates to the field of image analysis and discloses a railway wagon image analysis method which comprises the steps of obtaining a wagon image of a railway wagon to be analyzed, utilizing a trained reconstruction neural network to reconstruct the wagon image to obtain a reconstruction image, calculating a reconstruction error between the reconstruction image and the wagon image, judging whether a state foreign object exists in the wagon image according to the reconstruction error, identifying a foreign object area in the wagon image when the state foreign object exists in the wagon image, inquiring a part to be detected of the railway wagon to be analyzed, positioning the part area of the part to be detected in the wagon image, performing fault detection on the part area, determining the fault type and the key area of the fault part, calculating the abnormal score of the key area, determining the abnormal area of the fault part according to the abnormal score, and performing information fusion on the foreign object area, the fault type and the abnormal area to obtain an analysis result of the wagon image. The invention can improve the real-time performance of the railway wagon image analysis.
Inventors
- GONG SHIJUN
- JIAO YANG
- SHI HONGMEI
- WANG YAO
- XU JIANXI
- LI PENG
- DING YING
- WANG MENG
Assignees
- 国能铁路装备有限责任公司
- 北京交通大学
Dates
- Publication Date
- 20260505
- Application Date
- 20230427
Claims (8)
- 1. A method of analyzing an image of a railway wagon, the method comprising: Acquiring a truck image of a railway truck to be analyzed, reconstructing the truck image by using a trained reconstruction neural network to obtain a reconstruction image, calculating a reconstruction error between the reconstruction image and the truck image, and judging whether a state foreign object exists in the truck image according to the reconstruction error; When the state foreign matter exists in the truck image, identifying a foreign matter area in the truck image; Inquiring a part to be detected of the railway wagon to be analyzed, positioning a part area of the part to be detected in the wagon image, and performing fault detection on the part area to judge whether the part to be detected has a fault part or not; When the part to be detected has a fault part, determining the fault type of the fault part, extracting a key region of the fault part according to the fault type, calculating an abnormality score of the key region, and determining an abnormality region of the fault part according to the abnormality score; Information fusion is carried out on the foreign object area, the fault type and the abnormal area, and an analysis result of the truck image is obtained; The method comprises the steps of obtaining a differential image corresponding to a reconstruction error of a truck image, carrying out denoising treatment on the differential image to obtain a denoised image, carrying out image segmentation on the denoised image to obtain a segmented image, carrying out segmentation treatment on the segmented image to obtain segmented image blocks, calculating the structural similarity between adjacent segmented image blocks, carrying out similar fusion treatment on the segmented image blocks to obtain fusion image blocks when the structural similarity is greater than a preset structural similarity threshold, and determining the foreign object region in the truck image according to the fusion image blocks, wherein the step of calculating the structural similarity between the adjacent segmented image blocks comprises the following steps of calculating the structural similarity between the adjacent segmented image blocks by using the following formula: Wherein, the Representing the structural similarity between adjacent segmented image blocks, Representing the adjacent segmented image blocks, Representing segmented image blocks Is used for the color filter, Representing segmented image blocks Is used for the color filter, Representing segmented image blocks Is defined by the gray scale standard deviation of (c), Representing segmented image blocks Is defined by the gray scale standard deviation of (c), Indicating the brightness constant of the light source, Representing the contrast constant.
- 2. The method of analyzing a rail wagon image according to claim 1, wherein before reconstructing the wagon image by using the trained reconstruction neural network to obtain a reconstructed image, the method further comprises training the reconstruction neural network, including: initializing generator parameters and discriminator parameters in a pre-constructed reconstructed neural network, randomly selecting a wagon image sample of the pre-constructed reconstructed neural network from a pre-constructed wagon image database, and randomly selecting a noise sample of the pre-constructed reconstructed neural network from preset noise distribution; updating the generator parameters by utilizing a generator function in the pre-constructed reconstruction neural network according to the truck image sample and the noise sample to obtain updated generator parameters; The generator function includes: Wherein, the Representing the update of the generator parameters, Represent the first The generator parameters, G represents the truck image samples, D represents the noise samples, A sequence number representing a parameter of the generator, Representing the number of generator parameters; updating the parameters of the discriminators by utilizing the discriminator functions in the pre-constructed reconstructed neural network according to the truck image samples and the noise samples to obtain updated parameters of the discriminators; The discriminant function includes: Wherein, the Indicating that the arbiter parameters are updated, Represent the first The number of arbiter parameters, D, represents the noise samples, Represent the first The generator parameters, G, represent the truck image samples, A sequence number representing a parameter of the arbiter, Representing the number of arbiter parameters; And iterating the updating parameters of the discriminator and the updating parameters of the generator, obtaining equalization generating parameters and equalization judging parameters when the pre-constructed reconstruction neural network reaches Nash equalization, and generating a trained reconstruction neural network according to the equalization generating parameters and the equalization judging parameters.
- 3. The method of analyzing an image of a railway wagon as defined in claim 1, wherein the performing fault detection on the component area to determine whether the component to be detected has a faulty component includes: identifying the part name of the part region, extracting the region characteristics of the part region, and splicing the region characteristics according to the part name to obtain splicing characteristics; extracting splicing normal features of a pre-constructed normal part image database, and calculating the similarity of the splicing features and the splicing normal features; When the similarity is larger than a preset similarity threshold, judging that no fault part exists in the part to be detected; and when the similarity is not greater than a preset similarity threshold, judging that the part to be detected has a fault part.
- 4. The method for analyzing the railway wagon image according to claim 1, wherein when the part to be detected has a faulty part, determining the fault type of the faulty part includes: acquiring the part area of the part to be detected, and identifying the type of the part corresponding to the part to be detected; Detecting the part region by using a trained fault detection network according to the type of the part, and obtaining a fault score of the part region; and determining the fault type of the fault part according to the fault score.
- 5. The railway wagon image analysis method as defined in claim 1, wherein the determining an abnormal region of the faulty component according to the abnormality score includes: Configuring a mapping relation between the abnormal score and a pre-constructed color data table, and constructing a thermodynamic diagram of the abnormal score according to the mapping relation; and when the color chromaticity of the thermodynamic diagram is larger than a preset chromaticity threshold, identifying a corresponding region of the thermodynamic diagram, and taking the corresponding region as an abnormal region of the fault part.
- 6. An image analysis device for a railway wagon, the device comprising: The foreign matter judging module is used for acquiring a truck image of the railway truck to be analyzed, reconstructing the truck image by using a trained reconstruction neural network to obtain a reconstruction image, calculating a reconstruction error between the reconstruction image and the truck image, and judging whether a state foreign matter exists in the truck image according to the reconstruction error; the foreign matter identification module is used for identifying a foreign matter area in the truck image when the state foreign matter exists in the truck image; The fault detection module is used for inquiring the to-be-detected parts of the railway wagon to be analyzed, positioning the parts to be detected in the parts areas in the wagon image, and carrying out fault detection on the parts areas to judge whether the to-be-detected parts have fault parts or not; The abnormality identification module is used for determining the fault type of the fault part when the fault part exists in the part to be detected, extracting a key region of the fault part according to the fault type, calculating an abnormality score of the key region, and determining an abnormality region of the fault part according to the abnormality score; The analysis result generation module is used for carrying out information fusion on the foreign object region, the fault type and the abnormal region to obtain an analysis result of the truck image, wherein the identification of the foreign object region in the truck image comprises the steps of obtaining a differential image corresponding to a reconstruction error of the truck image, carrying out denoising processing on the differential image to obtain a denoising image, carrying out image segmentation on the denoising image to obtain a segmented image, carrying out segmentation processing on the segmented image to obtain segmented image blocks, calculating structural similarity between adjacent segmented image blocks, carrying out similar fusion processing on the segmented image blocks when the structural similarity is greater than a preset structural similarity threshold value to obtain a fusion image block, determining the foreign object region in the truck image according to the fusion image block, and calculating the structural similarity between adjacent segmented image blocks, wherein the calculation of the structural similarity between adjacent segmented image blocks comprises the following steps: Wherein, the Representing the structural similarity between adjacent segmented image blocks, Representing the adjacent segmented image blocks, Representing segmented image blocks Is used for the color filter, Representing segmented image blocks Is used for the color filter, Representing segmented image blocks Is defined by the gray scale standard deviation of (c), Representing segmented image blocks Is defined by the gray scale standard deviation of (c), Indicating the brightness constant of the light source, Representing the contrast constant.
- 7. An electronic device, the electronic device comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the rail wagon image analysis method of any of claims 1 to 5.
- 8. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the rail wagon image analysis method according to any one of claims 1 to 5.
Description
Railway wagon image analysis method and device, electronic equipment and storage medium Technical Field The invention relates to the field of intelligent decision making, in particular to a railway wagon image analysis method, a railway wagon image analysis device, electronic equipment and a storage medium. Background With the continuous expansion of the railway network scale, the operating mileage and freight traffic are also continuously increased, which puts higher demands on the freight car running safety. At present, the fault analysis and judgment of parts of the railway freight car are realized by adopting a dynamic image detection system (TFDS) for freight car operation faults in China, but with the increase of railway freight cars and the increase of car operation rate, the contradiction between the rapid increase of overhaul workload and the shorter and shorter time left for overhaul operation is increasingly prominent, so that an intelligent analysis method for railway freight car images is urgently needed. The traditional method based on the traditional image processing technology is mainly adopted in the existing research surrounding the railway wagon image analysis, and has higher requirements on image quality, and fault characteristics are required to be designed and extracted manually, so that the method can only identify specific faults, has low universality, has low detection speed and low accuracy, and cannot meet the real-time requirements of practical application. Disclosure of Invention The invention provides a railway wagon image analysis method and system, which mainly aim to improve the detection accuracy and real-time performance of railway wagon image analysis. In order to achieve the above object, the present invention provides a method for analyzing an image of a railway wagon, comprising: Acquiring a truck image of a railway truck to be analyzed, reconstructing the truck image by using a trained reconstruction neural network to obtain a reconstruction image, calculating a reconstruction error between the reconstruction image and the truck image, and judging whether a state foreign object exists in the truck image according to the reconstruction error; When the state foreign matter exists in the truck image, identifying a foreign matter area in the truck image; Inquiring a part to be detected of the railway wagon to be analyzed, positioning a part area of the part to be detected in the wagon image, and performing fault detection on the part area to judge whether the part to be detected has a fault part or not; When the part to be detected has a fault part, determining the fault type of the fault part, extracting a key region of the fault part according to the fault type, calculating an abnormality score of the key region, and determining an abnormality region of the fault part according to the abnormality score; and carrying out information fusion on the foreign object area, the fault type and the abnormal area to obtain an analysis result of the truck image. Optionally, before reconstructing the truck image by using the trained reconstruction neural network to obtain a reconstructed image, training the reconstruction neural network further includes: initializing generator parameters and discriminator parameters in a pre-constructed reconstructed neural network, randomly selecting a wagon image sample of the pre-constructed reconstructed neural network from a pre-constructed wagon image database, and randomly selecting a noise sample of the pre-constructed reconstructed neural network from preset noise distribution; updating the generator parameters by utilizing a generator function in the pre-constructed reconstruction neural network according to the truck image sample and the noise sample to obtain updated generator parameters; The generator function includes: Wherein, the Representing updated generator parameters, z i representing the ith generator parameter, G representing a truck image sample, D representing a noise sample, i representing the number of generator parameters, n representing the number of generator parameters; updating the parameters of the discriminators by utilizing the discriminator functions in the pre-constructed reconstructed neural network according to the truck image samples and the noise samples to obtain updated parameters of the discriminators; The discriminant function includes: Wherein V denotes the updated arbiter parameter, x i denotes the i-th arbiter parameter, D denotes the noise sample, z i denotes the i-th generator parameter, G denotes the truck image sample, i denotes the number of the arbiter parameters, and n denotes the number of the arbiter parameters; And iterating the updating parameters of the discriminator and the updating parameters of the generator, obtaining equalization generating parameters and equalization judging parameters when the pre-constructed reconstruction neural network reaches Nash equalization, and generating a t