Online visual inspection and defect positioning method for flexible hose composite material production line
By combining a linear array hyperspectral camera and a production line synchronous encoder with a cylindrical unfolded hyperspectral dual-branch depth autoencoder model, the problem of accurate defect identification on a high-speed production line for flexible hose composite materials was solved, achieving efficient defect detection and location, and improving the level of production quality control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGSHA TOPZONE PLASTIC
- Filing Date
- 2026-04-13
- Publication Date
- 2026-05-12
AI Technical Summary
Existing methods for inspecting flexible flexible hose composite materials are ineffective in identifying surface and internal defects that are small in size, diverse in type, discretely distributed, and irregular in shape. In particular, the accuracy of inspection is limited on high-speed production lines. Traditional two-dimensional vision systems cannot obtain spectral dimension information of materials, resulting in weak identification of defects such as uneven transparent coatings, impurity mixing, and local aging.
By combining a linear array hyperspectral camera and a production line synchronous encoder, and through cylindrical unfolding resampling and hyperspectral imaging, combined with a cylindrical unfolding hyperspectral dual-branch depth autoencoder model, spectral normalization and superpixel region division are performed. The reconstruction difference index is calculated to generate a stable defect region mask, thereby achieving precise defect localization.
It achieves high robustness, high precision and high real-time detection of flexible hose composite materials on high-speed production lines. It can identify deep material anomalies, reduce misjudgments caused by light fluctuations, improve the ability to capture minute defects, and can be directly used for online marking and rejection operations of production line actuators.
Smart Images

Figure CN122016653A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, specifically relating to an online visual inspection and defect location method for flexible hose composite material production lines. Background Technology
[0002] Flexible hose composite materials are widely used in the automotive, construction machinery, petrochemical transportation, and industrial equipment industries. As the requirements for pressure ratings, corrosion resistance, and flexibility in working environments continue to increase, the manufacturing processes for flexible hose composite materials are constantly evolving. The condition of the internal reinforcing layer, the outer rubber layer, and the bonding interface layer has a decisive impact on product performance. However, the surface and internal defects of flexible hose composite materials are often characterized by small size, diverse types, scattered distribution, and irregular shapes. The high speed of production lines makes it difficult to guarantee the stability of manual inspection; therefore, relying on automated visual inspection technology has become an industry trend.
[0003] In existing technologies, the mainstream methods for inspecting flexible hose composite materials typically employ detection techniques including 2D cameras, line laser profilometers, infrared cameras, or traditional visible light spectrometers. These methods can identify defects such as bubbles, breakage, foreign matter adhesion, uneven welding, or abnormal outer coating thickness based on brightness differences, surface texture variations, or simple spectral reflectance characteristics. However, the light reflectance characteristics of flexible hose composite material surfaces vary significantly with differences in color, surface roughness, illumination direction, and processing technology, which significantly limits the accuracy of 2D image-based detection. For example, in visible light images, local texture fluctuations in normal materials and minor defects appear similar in grayscale or color, making it difficult for the system to achieve stable segmentation. Furthermore, 2D vision systems cannot acquire spectral dimension information of the material and cannot reveal deep-seated characteristics of material differences. Therefore, they are less effective at identifying defects that are difficult to detect through color or brightness contrast, such as uneven transparent coatings, impurity mixing, and localized aging. Summary of the Invention
[0004] The main objective of this invention is to provide an online visual inspection and defect location method for flexible hose composite material production lines.
[0005] To solve the above problems, the technical solution of the present invention is implemented as follows: An online visual inspection and defect location method for flexible hose composite material production lines includes the following steps: Step 1: Linear array hyperspectral cameras and production line synchronous encoders are arranged along the conveying direction on the flexible hose composite material production line. Under the trigger control of the production line synchronous encoder, the linear array hyperspectral camera acquires multi-channel spectral linear array images in the axial direction. The industrial control computing unit performs cylindrical unfolding resampling based on the axial position pulse signal provided by the production line synchronous encoder, the pre-calibrated outer diameter information of the flexible hose composite material, the installation geometric relationship between the optical axis of the linear array hyperspectral camera and the central axis of the flexible hose composite material, and the axial displacement interval between adjacent triggering times of the linear array hyperspectral camera. The spectral linear array is combined into a cylindrical unfolded hyperspectral image sequence and arranged into a spectral space data cube to establish the geometric space coordinate system of the flexible hose composite material. Step 2: Construct a cylindrical unfolded hyperspectral dual-branch deep autoencoder model, perform spectral normalization and superpixel region segmentation on the cylindrical unfolded hyperspectral image, input the average spectral sequence of the superpixel region into the cylindrical unfolded hyperspectral dual-branch deep autoencoder model to obtain the reconstructed spectral sequence, calculate the reconstruction difference index, determine the online reconstruction difference segmentation threshold based on the frequency distribution of the reconstruction difference index, mark the superpixel region with the reconstruction difference index not lower than the online reconstruction difference segmentation threshold as the spectral anomalous superpixel region, and merge adjacent spectral anomalous superpixel regions to obtain the spectral anomalous candidate region set; Step 3: Map the spectral anomaly candidate regions onto the actual surface of the flexible hose composite material to generate an initial set of geometric candidate defect regions. Perform image segmentation and morphological processing on the initial geometric candidate defect regions to obtain a stable defect region mask. Extract the positional parameters of the stable defect regions as the defect localization results.
[0006] Furthermore, in step one, the industrial control computing unit combines the spectral linear array around the entire circumference of the flexible hose composite material into a cylindrical unfolded hyperspectral image sequence with the axial and circumferential unfolding directions as planes. Within the industrial control computing unit, the cylindrical unfolded hyperspectral image sequence is arranged into a spectral space data cube in the spectral channel direction, axial direction, and circumferential unfolding direction. The geometric space coordinate system of the flexible hose composite material is established by the cumulative result of the axial position pulse of the production line synchronous encoder and the row and column index of the cylindrical unfolded hyperspectral image, so that the axial position, circumferential position and actual position of each pixel in the spectral space data cube on the flexible hose composite material in the production line conveying direction have a one-to-one correspondence.
[0007] Furthermore, the superpixel region segmentation in step two adopts a region growing method, specifically including: using a number of spaced pixels as seed pixels, merging pixels adjacent to the seed pixels and whose reflection intensity differences in all spectral channels are within a preset similarity range into the same superpixel region, and continuously expanding to adjacent pixels until the spectral difference between adjacent pixels exceeds the preset similarity range or the superpixel region reaches the preset area limit, forming a superpixel region segmentation result that covers the entire cylindrical unfolded hyperspectral image.
[0008] Furthermore, the cylindrical unfolded hyperspectral dual-branch deep autoencoder model in step two includes two encoding and decoding paths: a single-point spectral branch and an axial neighborhood spectral branch. The single-point spectral branch takes the average spectral sequence of a single superpixel region as input, and sequentially reduces the spectral channel dimension layer by layer through multiple fully connected encoding layers to form a compressed spectral feature vector. Then, it uses multiple fully connected decoding layers symmetrical to the encoding layer structure to restore the compressed spectral feature vector to the reconstructed spectral sequence. The axial neighborhood spectral branch takes the average spectral sequence of three superpixel regions adjacent along the axial direction in the cylindrical unfolded coordinate system as input, and concatenates the three average spectral sequences in axial order to form an axial spectral neighborhood block. A one-dimensional convolutional encoding layer performs sliding convolution on the axial spectral neighborhood block in the axial direction to extract axial variation features, and a fully connected layer compresses the convolution result into an axial compressed spectral feature vector. Finally, a combination of a one-dimensional deconvolutional decoding layer and a fully connected decoding layer restores the axial compressed spectral feature vector to the axial reconstructed spectral sequence corresponding to the three positions.
[0009] Furthermore, in step two, the industrial control computing unit inputs the average spectral sequence of each superpixel region in the training sample set into the single-point spectral branch and the axial neighborhood spectral branch respectively during the training phase to obtain the single-point reconstructed spectral sequence and the axial reconstructed spectral sequence. By averaging the absolute values of the channel differences between the input average spectral sequence and the single-point reconstructed spectral sequence, and averaging the absolute values of the channel differences between the corresponding reconstructed spectral sequences in the input average spectral sequence and the axial reconstructed spectral sequence, the single-point reconstruction difference index and the axial reconstruction difference index are calculated. The sum of the two types of reconstruction difference indices is taken as the total reconstruction difference index of the training sample. The network parameters of the cylindrical unfolded hyperspectral dual-branch deep autoencoder model are adjusted by gradient descent so that the total reconstruction difference index of the training sample gradually decreases until the change range is within a stable range within the preset training rounds.
[0010] Furthermore, in step two, during the formal operation of the production line, the industrial control computing unit generates an online cylindrical unfolded hyperspectral image for each spectral space data cube using a cylindrical unfolding method. It uses the same spectral normalization preprocessing and superpixel region construction method as in the training phase to generate an online superpixel region set. For each superpixel region in the online superpixel region set, it calculates the average spectral sequence and inputs it into the trained cylindrical unfolded hyperspectral dual-branch deep autoencoder model to obtain the corresponding single-point reconstruction spectral sequence and axial reconstruction spectral sequence. It calculates the single-point reconstruction difference index and axial reconstruction difference index for each superpixel region, adds them together to form the online total reconstruction difference index, and fills all the online total reconstruction difference indices into the online reconstruction difference index map according to the axial and circumferential positions of the superpixel regions in the cylindrical unfolded coordinate system.
[0011] Furthermore, the industrial control computing unit reads all online total reconstruction difference indicators from the online reconstruction difference indicator map, statistically analyzes the frequency distribution of the online total reconstruction difference indicators, selects the continuous online total reconstruction difference indicator interval with the highest frequency as the normal material reconstruction difference interval, selects an online reconstruction difference segmentation threshold within an online total reconstruction difference indicator interval outside the upper boundary of the normal material reconstruction difference interval, marks the superpixel regions with online total reconstruction difference indicators not lower than the online reconstruction difference segmentation threshold as spectral anomalous superpixel regions, obtains a set of spectral anomalous superpixel regions, and merges adjacent spectral anomalous superpixel regions in the cylindrical unfolded coordinate system according to the connectivity of the spectral anomalous superpixel regions in the axial and circumferential unfolded directions, obtains a set of spectral anomalous candidate regions.
[0012] Furthermore, in step two, the industrial control computing unit calls the cylindrical unfolded hyperspectral dual-branch depth autoencoder training module during the equipment installation and debugging phase. Multiple spectral spatial data cubes are collected from the flexible hose composite material sample that has been manually confirmed as qualified. The same cylindrical unfolding method as in step one is used to generate a training cylindrical unfolded hyperspectral image sequence. For each cylindrical unfolded hyperspectral image in the training cylindrical unfolded hyperspectral image sequence, dark current correction and reflection intensity normalization are performed on each spectral channel in the industrial control computing unit according to the spectral channel order to obtain a spectrally normalized cylindrical unfolded hyperspectral image.
[0013] Furthermore, in step three, the industrial control computing unit maps the axial and circumferential position indices of each spectral anomaly candidate region in the spectral anomaly candidate region set to the actual surface of the flexible hose composite material through the geometric space coordinate system of the flexible hose composite material established in step one, generating a corresponding initial geometric candidate defect region set. For each initial geometric candidate defect region, a brightness channel and a preset key spectral channel are selected in the original cylindrical unfolded hyperspectral image to form a two-dimensional grayscale image. The industrial control computing unit performs fixed threshold segmentation on the two-dimensional grayscale image to obtain an initial binary defect mask.
[0014] Furthermore, the industrial control computing unit sequentially performs morphological dilation and morphological erosion operations on the initial binary defect mask to eliminate isolated small noise points and make the boundaries of the real defect region coherent. Then, it performs morphological opening and boundary smoothing operations on the binary defect mask after dilation and erosion to obtain a stable defect region mask. The stable defect region mask is mapped back to the geometric space coordinate system of the flexible hose composite material. The starting and ending positions of each stable defect region along the axial direction, the starting and ending positions along the circumferential direction, and the corresponding trigger positions of the actuators in the production line conveying direction are extracted. The industrial control computing unit sends these position parameters and the contour information of the stable defect region in the cylindrical unfolded coordinate system as the defect location result to the production line actuator for online marking, removal, or classification of defect segments of the flexible hose composite material.
[0015] The online visual inspection and defect localization method for flexible hose composite material production lines of the present invention has the following beneficial effects: By combining cylindrical unfolding resampling, hyperspectral imaging, and a dual-branch depth autoencoder for online visual inspection of flexible hose composite materials, the present invention enables the acquisition of structured, homogenized, and reproducible spectral spatial data of the flexible hose composite material even under continuous high-speed conveying conditions, providing a stable data foundation for defect identification. By reorganizing the circumferential pixels of the flexible hose composite material into uniform sampling points through cylindrical unfolding, the spectral curve distortion problem caused by changes in viewing angle in traditional single-view imaging is avoided, fundamentally solving the detection instability caused by significant differences in the reflectance characteristics of the cylindrical surface material at different orientations. The use of hyperspectral imaging to capture the full-band reflectance characteristics of the material enables the present invention to identify deep material anomalies that are difficult to judge based solely on brightness and texture, including weak spectral shifts, impurity contamination, material aging, and uneven interlayer distribution. By constructing a cylindrical unfolded hyperspectral dual-branch depth autoencoder, the spectral representation of normal materials is reconstructed from the perspectives of single-point spectral features and axial continuous spectral features, enabling the invention to simultaneously utilize local spectral density and spatial continuity to determine the material state, maintaining high sensitivity even when detecting subtle anomalies within the material. By reconstructing difference indices to accurately screen anomalous regions, the invention reduces misjudgments in traditional thresholding under fluctuating lighting conditions and improves the ability to capture minute defects. After generating spectral anomaly candidate regions, the invention accurately maps image coordinates to the actual surface of the flexible hose composite material using a geometric spatial coordinate system. This allows the defect location results to be directly used for online marking and rejection operations of production line actuators, avoiding additional size conversion and coordinate derivation processes and improving the response efficiency between detection and execution. The generation method of the stable defect region mask combines spectral differences, brightness information, and morphological processing, making the boundaries of the defect region more complete and smooth, reducing noise interference, and improving the interpretability of the defect morphology. In summary, this invention achieves synergistic advantages in multiple aspects such as spectral acquisition, data organization, anomaly identification, and defect localization, realizing high robustness, high precision, and high real-time performance in online detection of flexible hose composite materials, which can effectively improve the level of production quality control and manufacturing efficiency. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the online acquisition and geometric imaging principle provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the morphological processing provided in an embodiment of the present invention; Figure 3 A schematic diagram illustrating the principle of cylinder unfolding resampling and geometric space coordinate mapping provided in an embodiment of the present invention. Detailed Implementation
[0017] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0018] An online visual inspection and defect location method for flexible hose composite material production lines includes the following steps: Step 1: Linear array hyperspectral cameras and production line synchronous encoders are arranged along the conveying direction on the flexible hose composite material production line. Under the trigger control of the production line synchronous encoder, the linear array hyperspectral camera acquires multi-channel spectral linear array images in the axial direction. The industrial control computing unit performs cylindrical unfolding resampling based on the axial position pulse signal provided by the production line synchronous encoder, the pre-calibrated outer diameter information of the flexible hose composite material, the installation geometric relationship between the optical axis of the linear array hyperspectral camera and the central axis of the flexible hose composite material, and the axial displacement interval between adjacent triggering times of the linear array hyperspectral camera. The spectral linear array is combined into a cylindrical unfolded hyperspectral image sequence and arranged into a spectral space data cube to establish the geometric space coordinate system of the flexible hose composite material. Step 2: Construct a cylindrical unfolded hyperspectral dual-branch deep autoencoder model, perform spectral normalization and superpixel region segmentation on the cylindrical unfolded hyperspectral image, input the average spectral sequence of the superpixel region into the cylindrical unfolded hyperspectral dual-branch deep autoencoder model to obtain the reconstructed spectral sequence, calculate the reconstruction difference index, determine the online reconstruction difference segmentation threshold based on the frequency distribution of the reconstruction difference index, mark the superpixel region with the reconstruction difference index not lower than the online reconstruction difference segmentation threshold as the spectral anomalous superpixel region, and merge adjacent spectral anomalous superpixel regions to obtain the spectral anomalous candidate region set; Step 3: Map the spectral anomaly candidate regions onto the actual surface of the flexible hose composite material to generate an initial set of geometric candidate defect regions. Perform image segmentation and morphological processing on the initial geometric candidate defect regions to obtain a stable defect region mask. Extract the positional parameters of the stable defect regions as the defect localization results.
[0019] In the specific implementation of the flexible hose composite material production line, a linear array hyperspectral camera and a production line synchronous encoder are first fixedly installed above or to the side of the flexible hose composite material conveying path. The linear array hyperspectral camera is arranged along the conveying direction of the flexible hose composite material, so that the linear array direction of the camera corresponds to the circumferential direction of the flexible hose composite material, and the field of view of the camera covers the entire circumferential area or a predetermined circumferential area of the outer surface of the flexible hose composite material. The production line synchronous encoder is mechanically connected to the traction roller that drives the flexible hose composite material conveying through a coupling or synchronous belt. For each rotation of the traction roller, the production line synchronous encoder outputs a fixed number of axial position pulse signals. For example, when the circumference length of the traction roller is 200 mm, the production line synchronous encoder outputs 2000 axial position pulse signals per rotation. The industrial control computing unit can then correspond each axial position pulse signal to a 0.1 mm displacement in the axial direction of the flexible hose composite material. In this way, the industrial control computing unit controls the row acquisition rhythm of the linear array hyperspectral camera based on the actual displacement of the flexible hose composite material. That is, the line trigger signal obtained by the synchronous encoder of the production line is connected to the trigger input terminal of the linear array hyperspectral camera, so that the linear array hyperspectral camera acquires a row of multi-channel spectral linear array images every fixed axial displacement interval of the flexible hose composite material.
[0020] In the specific configuration of the online hyperspectral camera, a camera with 1024 spectral channels and 2048 spatial sampling pixels can be selected. The spatial sampling pixels are arranged along the linear array direction, covering the circumferential projection area of the outer surface of the flexible hose composite material. During the installation and commissioning phase on the production line, the industrial control computing unit selects the lens focal length and installation height of the online hyperspectral camera according to the target diameter of the flexible hose composite material, so that the effective field of view in the linear array direction is slightly larger than the viewing angle corresponding to the outer diameter of the flexible hose composite material. For example, when the outer diameter of the flexible hose composite material is 40 mm, the online hyperspectral camera is installed 200 mm away from the central axis of the flexible hose composite material. By adjusting the lens focal length and pitch angle, the online hyperspectral camera can obtain a spectral linear array image covering the entire circumference of the flexible hose composite material during single-line exposure, thereby ensuring that surface points at different circumferential positions can obtain corresponding pixels in the spectral linear array. To improve the quality of reflected signals, bar light sources can be arranged along the linear array direction on both sides of the linear array hyperspectral camera. The bar light sources use light source devices with uniform continuous spectrum, and the illumination is distributed as evenly as possible on the circumference of the flexible tubular composite material through a diffuse reflector. In this way, the multi-channel spectral linear array image has a high signal-to-noise ratio in each spectral channel.
[0021] refer to Figure 1 , Figure 1This diagram illustrates the data acquisition and geometric imaging principle of the online visual inspection system for flexible hose composite material production lines provided in this embodiment of the invention. As shown, the system is primarily deployed in the production and conveying stage of the flexible hose composite material. The core hardware components include a linear array hyperspectral camera arranged along the conveying direction, a production line synchronous encoder, and corresponding lighting sources and industrial control computing units. The flexible hose composite material, as the object of inspection, is a cylindrical structure with a fixed outer diameter and is continuously conveyed along the axial direction indicated by the arrow in the diagram under the drive of the traction mechanism.
[0022] The linear array hyperspectral camera is fixedly mounted above or to the side of the flexible tubular composite material. Its mounting position is determined by a pre-calibrated mounting height H and field of view angle. The camera's optical axis is perpendicular to the central axis of the flexible tubular composite material, and the direction of the camera's linear array photosensitive units is parallel to the circumferential tangent direction of the flexible tubular composite material's cross-section. The fan-shaped area shown by the dashed line in the figure represents the instantaneous field of view of the linear array hyperspectral camera, which forms a narrow, single-line spectral scan line on the surface of the flexible tubular composite material. Through adjustment of the optical lens, this scan line covers the effective circumferential projection area of the outer surface of the flexible tubular composite material, ensuring that spectral reflectance information of the material surface can be acquired.
[0023] The production line synchronous encoder is mechanically connected to the traction roller or conveyor shaft that drives the flexible hose composite material via a coupling. As the flexible hose composite material moves, the production line synchronous encoder rotates synchronously and outputs high-precision axial position pulse signals. These pulse signals are not used directly for simple counting, but are instead used as hard trigger signals to the trigger input of a linear array hyperspectral camera. Figure 1 The dashed arrows in the diagram illustrate this signal connection, indicating that the camera's acquisition rhythm is entirely controlled by the actual physical displacement of the material. Regardless of fluctuations in the production line's conveyor speed, whenever the flexible hose composite material moves axially by a preset fixed displacement interval (e.g., 0.5 mm), the encoder sends a trigger command, driving the linear array hyperspectral camera to perform one exposure acquisition, obtaining a single line of multi-channel spectral linear array images.
[0024] In the processing logic of the industrial control computing unit, Figure 1The process of mapping from physical space to data space was also demonstrated. Each line of raw spectral image data acquired contained background pixels and effective material pixels. Based on the pre-calibrated outer diameter information of the flexible hose composite material and the geometric projection relationship between the camera and the cylindrical surface, the system executed a cylindrical unfolding resampling algorithm. This algorithm maps the effective pixels in the linear array image to the circumferential unfolding position of the cylindrical surface, thereby eliminating the projection distortion caused by the cylindrical curved surface. As the material is continuously transported, the continuously acquired multiple lines of spectral data are arranged strictly in axial order, and finally a cylindrical unfolding hyperspectral image as shown in the figure is constructed in the computer memory. This image establishes a two-dimensional geometric space coordinate system, where the horizontal axis corresponds to the actual axial position of the flexible hose composite material, the vertical axis corresponds to the circumferential angular position (0 degrees to 360 degrees) along the circumference, and each pixel stores the spectral reflectance intensity data of the corresponding physical position in multiple bands, forming the basis of the spectral space data cube required by the subsequent defect detection algorithm. In this way, Figure 1 The proposed solution transforms the problem of continuous detection of a three-dimensional cylindrical surface into the problem of analyzing a two-dimensional planar hyperspectral image, providing a unified geometric benchmark for subsequent precise defect localization.
[0025] The industrial control computing unit counts the axial position pulse signals provided by the production line synchronous encoder and generates corresponding trigger signals for the linear array hyperspectral camera based on a pre-set axial displacement interval. For example, if the industrial control computing unit combines every 5 axial position pulse signals into a single row trigger signal, then the axial displacement interval between two adjacent rows of acquisition positions of the flexible hose composite material in the axial direction is 0.5 mm. Thus, even if the conveying speed of the flexible hose composite material fluctuates, the axial position of the flexible hose composite material corresponding to each row of multi-channel spectral linear array images acquired by the linear array hyperspectral camera driven by the industrial control computing unit remains at a fixed interval, ensuring that the spatial sampling interval of the spectral linear array in the axial direction is constant. This is beneficial for subsequent cylindrical unfolding resampling and the construction of the spectral spatial data cube. In an optional approach, the industrial control computing unit can also set the axial displacement interval to 0.2 mm, 0.5 mm, or 1 mm according to the detection accuracy requirements of the production task, achieving a balance between different detection accuracies and data volume through software parameter configuration.
[0026] To achieve cylindrical unfolding resampling and combine the spectral linear array into a sequence of cylindrical unfolded hyperspectral images, the industrial control computing unit executes a geometric calibration process during system initialization. Geometric calibration includes calibrating the outer diameter information of the flexible hose composite material and calibrating the installation geometry between the optical axis of the linear array hyperspectral camera and the central axis of the flexible hose composite material. Outer diameter calibration can be performed by measuring multiple points on the outer surface of the flexible hose composite material with a measuring tool while the production line is stopped, and recording the average outer diameter. For example, if the measured outer diameter of the flexible hose composite material is 40 mm, this value is used as the reference outer diameter for subsequent cylindrical unfolding resampling. Installation geometry calibration can be performed by attaching a high-contrast marking line extending circumferentially to the outer surface of the flexible hose composite material, then starting the production line to transport the flexible hose composite material at a low speed, allowing the linear array hyperspectral camera to continuously acquire multiple rows of multi-channel spectral linear array images. The industrial control computing unit extracts the brightness channel or selects a spectral channel from the acquired spectral linear array image, records the pixel positions of high-contrast marker lines in different spectral linear arrays, and infers the relative positional relationship between the optical axis of the linear array hyperspectral camera and the central axis of the flexible hose composite material based on the projection trajectory of the marker lines in image space. For example, it confirms that the central pixel in the linear array direction corresponds to a fixed circumferential position on the circumference of the flexible hose composite material, and calculates the effective pixel range of the circumferential projection in the image. Through this calibration method, each spatially sampled pixel in the spectral linear array image can be associated with a specific circumferential position on the circumference of the flexible hose composite material.
[0027] During the cylindrical unfolding resampling process, the industrial control computing unit processes each row of multi-channel spectral linear array images. For each row of multi-channel spectral linear array images, the industrial control computing unit first truncates the calibrated effective pixel range in the spatial dimension, ensuring that only pixels corresponding to the outer surface of the flexible hose composite material are retained. Then, based on the outer diameter information of the flexible hose composite material and the installation geometry of the linear array hyperspectral camera, each pixel within the effective pixel range is mapped to a circumferential position on the circumference of the flexible hose composite material. For example, when the effective pixel range is 1800 pixels, the industrial control computing unit evenly distributes these 1800 pixels to 360 circumferential unfolding sampling points, so that each circumferential unfolding sampling point corresponds to 5 original pixels, and takes the arithmetic mean of the spectral reflectance intensity of these 5 original pixels, thereby obtaining the spectral data of the circumferential unfolding sampling point in each spectral channel. In this way, the industrial control computing unit smooths the spatial sampling non-uniformity in the original multi-channel spectral linear array image into uniform unfolded sampling in the circumferential direction, so that the subsequent cylindrical unfolded hyperspectral image has a regular pixel grid in the circumferential direction, which is beneficial for measuring the size and position of the defect region in the circumferential direction.
[0028] As the flexible hose composite material is conveyed on the production line, a linear array hyperspectral camera continuously acquires multiple rows of multi-channel linear spectral images under the trigger control of the production line's synchronous encoder. The industrial control computing unit performs the aforementioned cylindrical unfolding resampling operation on each row of multi-channel linear spectral images, arranging the one-dimensional circumferential unfolded spectral data obtained from each resampled row in the axial direction according to the acquisition sequence, thus forming a single frame of cylindrical unfolded hyperspectral image data with the axial and circumferential unfolding directions as two-dimensional planes. When the flexible hose composite material is conveyed along a certain length in the axial direction, for example, when 2000 rows of circumferential unfolded spectral data are continuously acquired, the industrial control computing unit constructs these 2000 rows of data into a single cylindrical unfolded hyperspectral image. This image has 2000 rows of pixels in the axial direction, 360 columns of pixels in the circumferential unfolding direction, and all spectral channels provided by the linear array hyperspectral camera in the spectral channel direction, for example, 1024 spectral channels. To process longer lengths of flexible hose composite materials, the industrial control computing unit can sequentially stitch together multiple cylindrical unfolded hyperspectral images to form a sequence of cylindrical unfolded hyperspectral images covering the inspection area of the production line.
[0029] refer to Figure 3The left side of the image shows the surface structure of the flexible hose composite material in the original cylindrical coordinate system, while the right side shows the planar coordinate system after the cylinder is unfolded. The two sides are connected by a mapping arrow, and a geometric space coordinate transformation formula box is located at the bottom. In the original cylindrical coordinate system, the flexible hose composite material is cylindrical, and its surface is described using a three-dimensional coordinate system, including the axial direction Z, the circumferential direction θ, and the radial direction R. The cylindrical surface is divided into a regular grid. Circumferentially, there are annular grid lines spaced 40 mm apart, corresponding to different axial sampling positions; circumferentially, there are longitudinal grid lines spaced 36 degrees apart, evenly dividing the circumference into 10 sector regions. The top of the cylinder is marked with four key circumferential positions: 0°, 90°, 180°, and 270°, used to determine the origin and direction of the circumferential coordinates. An elliptical defect region is marked on the cylindrical surface, spanning multiple grid cells, to illustrate surface anomalies in actual inspection. The cylinder unfolding and resampling process is represented by the mapping arrow in the middle, converting the three-dimensional cylindrical surface coordinates into two-dimensional planar coordinates. The unfolding process maintains the axial direction unchanged, unfolding the circumferential arc into a horizontal straight line, achieving conformal mapping from a curved surface to a plane. In the unfolded plane coordinate system, a rectangular grid of 360 columns × 300 rows is presented. The horizontal axis represents the circumferential unfolding direction, and the vertical axis represents the axial direction. The horizontal axis scale ranges from 0° to 360°, marked at 60° intervals, corresponding to the unfolding of a complete circumference; the vertical axis scale ranges from 0 meters to 3.0 meters, marked at 0.5-meter intervals, representing the axial detection length of the flexible hose composite material. The unfolded grid maintains the same sampling density as the original cylindrical surface, with horizontal grid lines corresponding to axial sampling positions and vertical grid lines corresponding to circumferential sampling positions. The elliptical defect region on the original cylindrical surface is mapped to a rectangular region in the unfolded plane, located within the range of 200° to 280° circumferentially and 1.3 meters to 1.9 meters axially, preserving the spatial topology of the defect. The geometric spatial coordinate mapping relationship is precisely described by the formula box at the bottom. The X-coordinate in the Cartesian coordinate system is calculated using the formula X = R × cos(2π × column index / 360), and the Y-coordinate is calculated using the formula Y = R × sin(2π × column index / 360), where R is the outer diameter of the flexible hose composite material, and the column index is the circumferential position index in the unfolded plane. The Z-coordinate is calculated using the formula Z = axial row index × axial sampling interval, establishing a linear mapping relationship for the axial position. Through these mapping formulas, a bidirectional conversion between any pixel position in the unfolded hyperspectral image of the cylinder and the actual surface position of the flexible hose composite material can be achieved, providing a precise spatial coordinate reference for subsequent defect localization.
[0030] The industrial control computing unit organizes the sequence of cylindrical unfolded hyperspectral images in memory according to the spectral channel direction, axial direction, and circumferential unfolding direction. The cylindrical unfolded hyperspectral image under the same spectral channel is treated as a three-dimensional data block, and data blocks from different spectral channels are arranged according to their spectral channel indices, thus forming a spectral spatial data cube. Each element of the spectral spatial data cube corresponds to the reflection intensity value of a specific spatial location on the outer surface of the flexible hose composite material in a specific spectral channel. Through this organization, the industrial control computing unit can easily perform neighborhood searches and feature extraction in the axial direction, circumferential unfolding direction, and spectral channel direction when executing subsequent detection algorithms. For example, it can analyze material absorption peaks in the spectral channel direction and analyze the spatial continuity of defects in the axial and circumferential unfolding directions.
[0031] To establish the geometric spatial coordinate system of the flexible hose composite material, the industrial control computing unit accumulates and counts the axial position pulse signals output by the synchronous encoder of the production line during the acquisition process. The accumulated axial position pulse values are then converted into the actual axial position of the flexible hose composite material along the conveying direction using a preset conversion factor. Whenever the linear array hyperspectral camera completes the acquisition of a row of multi-channel spectral linear array images, the industrial control computing unit records the current accumulated axial position pulse value and associates it with the corresponding axial row index, thus establishing a correspondence between the axial row index and the actual axial position in the axial direction. In the circumferential unfolding direction, the industrial control computing unit maps the column index in the circumferential unfolding direction to the actual circumferential position based on the outer diameter and circumference length of the flexible hose composite material. This can be represented by arc length or angle; for example, 360 columns of pixels can be sequentially mapped to circumferential positions from 0 degrees to 360 degrees. Through this mapping method, the row index in the axial direction and the column index in the circumferential unfolding direction of any element in the spectral spatial data cube can be converted into the axial and circumferential positions on the actual surface of the flexible hose composite material.
[0032] In the definition of the geometric space coordinate system for flexible hose composite materials, the industrial control computing unit uses a fixed position at the production line entrance as the axial position zero point and a reference point on the upstream end face of the flexible hose composite material as the circumferential position zero point. As the flexible hose composite material is conveyed on the production line, the industrial control computing unit continuously updates the axial position offset of each cylinder's unfolded hyperspectral image in the spectral space data cube based on the accumulated axial position pulse value of the production line's synchronous encoder. This ensures that the unfolded hyperspectral images of the same flexible hose composite material formed at different detection times always correspond to the same axial position in the geometric space coordinate system. Thus, when a defect is detected at a certain location in a subsequent step, the industrial control computing unit can directly provide the position of the defect relative to the production line entrance and its position relative to the circumferential zero point of the flexible hose composite material based on the geometric space coordinate system, facilitating online marking or removal by the actuator at a predetermined location.
[0033] In one optional implementation, to improve circumferential sampling accuracy, a rotary drive structure is added to the flexible hose composite material production line. This allows the flexible hose composite material to rotate uniformly around its central axis while moving along the conveying direction. In this configuration, the industrial control computing unit can align the linear array direction of the linear array hyperspectral camera with the axial direction of the flexible hose composite material. The rotation of the flexible hose composite material itself ensures that the spectral linear array acquired at different times covers the entire circumferential position. Based on the rotation angle sensor signal from the rotary drive structure, the industrial control computing unit maps the column index of each row of multi-channel spectral linear array images to the circumferential position of the flexible hose composite material. Combined with the axial position pulse signal provided by the production line's synchronous encoder, resampling is performed in the axial direction, still achieving cylindrical unfolding resampling and constructing a spectral spatial data cube. In this way, users can flexibly choose between rotating the flexible hose composite material or having the linear array hyperspectral camera's field of view cover the entire circumference, depending on the production line's structural characteristics. Both schemes maintain consistency in their geometric coordinate system establishment, ensuring that subsequent defect detection and defect location steps are not affected.
[0034] After establishing the geometric space coordinate system of the flexible hose composite material, the industrial control computing unit performs spectral normalization processing on each cylindrical unfolded hyperspectral image obtained in step one, followed by superpixel region segmentation. Based on this, a cylindrical unfolded hyperspectral bi-branch deep autoencoder model is constructed. During the training and online operation phases, the cylindrical unfolded hyperspectral bi-branch deep autoencoder model is used to generate reconstructed spectral sequences, calculate reconstruction difference indices, and determine online reconstruction difference segmentation thresholds, thereby obtaining spectral anomaly superpixel regions and merging them into a set of spectral anomaly candidate regions.
[0035] During the spectral normalization process, the industrial control computing unit first uses a linear array hyperspectral camera to acquire a set of dark-field spectral images under shading conditions without flexible hose composite material. The arithmetic mean of these dark-field spectral images over time is then calculated to obtain a dark-field reference hyperspectral image. Next, under normal lighting conditions on the flexible hose composite material production line, a white board with high reflectivity and stable spectral characteristics is placed at the location of the flexible hose composite material, ensuring that the surface of the white board is geometrically aligned with the outer surface of the flexible hose composite material. A set of hyperspectral images of the white board is then acquired using the linear array hyperspectral camera, and the arithmetic mean over time is again calculated to obtain a white board reference hyperspectral image. After acquiring the actual cylindrical unfolded hyperspectral image, the industrial control computing unit performs dark current correction and reflection intensity normalization processing on each spectral channel. This involves subtracting the gray value of the dark-field reference hyperspectral image at the corresponding position and channel from the gray value of each pixel in the current spectral channel, and then linearly stretching the data based on the gray value of the white board reference hyperspectral image at the corresponding position and channel. This ensures that the numerical range of the data collected from different batches and at different times of the flexible hose composite material is unified to the same reflection intensity scale. This spectral normalization process can reduce the impact of light source brightness fluctuations, camera response non-uniformity, and ambient light interference on spectral data, making the spectral curves of the same material more consistent when collected at different times. This is beneficial for the cylindrical unfolded hyperspectral dual-branch deep autoencoder model to learn stable normal material spectral patterns.
[0036] After spectral normalization, the industrial control computing unit performs superpixel region partitioning in the axial and circumferential unfolding directions of the cylindrical unfolded hyperspectral image. Specifically, the industrial control computing unit selects seed pixels in the cylindrical unfolded hyperspectral image at predetermined row and column intervals, for example, selecting one pixel every four rows in the axial direction and every four columns in the circumferential unfolding direction. For each seed pixel, the industrial control computing unit reads the spectral reflectance intensity values of the seed pixel in all spectral channels to form the initial spectral reference vector of the seed pixel. Then, it searches for pixels directly adjacent to the seed pixel in the axial and circumferential unfolding directions, and uses these pixels as candidate pixels. For each candidate pixel, it calculates the absolute value of the difference between the spectral reflectance intensity value of the candidate pixel in all spectral channels and the spectral reference vector, and takes the arithmetic mean over all spectral channels to obtain the spectral difference value of the candidate pixel relative to the spectral reference vector. If the spectral difference is within a preset spectral similarity range, and the number of pixels in the current superpixel region does not exceed a preset area limit (e.g., not exceeding 200 pixels), then the candidate pixel is assigned to the current superpixel region, and the arithmetic mean of the spectral reflectance intensity of all pixels in each spectral channel within the current superpixel region is recalculated. This mean is used as the new spectral reference vector. The industrial control computing unit continues to expand outward based on the new spectral reference vector, sequentially using pixels adjacent to the boundary of the current superpixel region as candidate pixels for spectral difference and area constraint determination, until no candidate pixel meets the spectral similarity condition or the number of pixels in the current superpixel region reaches the preset area limit. At this point, the superpixel region is considered to be divided. The industrial control computing unit repeats the region growing process for all seed pixels in the above manner. Scattered pixels not assigned to any superpixel region can be merged into the nearest superpixel region with the smallest spectral difference, thus forming a set of globally covering, spatially relatively continuous, and spectrally relatively consistent superpixel regions on the cylindrical unfolded hyperspectral image. By using this superpixel region segmentation, a large number of pixels can be merged into fewer superpixel regions while preserving the shape of the defect boundary space as much as possible. This reduces the amount of data to be processed in subsequent steps and decreases the impact of a single noisy pixel on the detection results.
[0037] After obtaining the superpixel region, the industrial control computing unit performs an arithmetic average of the spectral reflectance intensity values of all pixels within each superpixel region across all spectral channels to obtain the average spectral sequence of that superpixel region. The average spectral sequence characterizes the overall reflectance properties of the material within the superpixel region at different wavelengths. Compared to the spectral curve of a single pixel, the average spectral sequence is numerically smoother and less susceptible to random noise and individual pixel anomalies, which is beneficial for the cylindrical unfolded hyperspectral dual-branch deep autoencoder model to learn the material characteristics of the flexible hose composite material. In an optional implementation, the industrial control computing unit can also perform a simple screening of the pixels within the superpixel region based on brightness or the reflectance intensity of a certain key spectral channel before calculating the average spectral sequence, eliminating pixels with extreme anomalies to further improve the stability of the average spectral sequence.
[0038] The cylindrical unfolded hyperspectral dual-branch deep autoencoder model, in its implementation, consists of a single-point spectral branch and an axial neighborhood spectral branch. During the encoding stage, these two branches extract local spectral features and axially continuous features from the average spectral sequence, respectively. During the decoding stage, they attempt to reconstruct the original average spectral sequence and axial neighborhood spectral sequence from the compressed features, respectively. The single-point spectral branch takes the average spectral sequence of a single superpixel region as input. The industrial control computing unit inputs the average spectral sequence into multiple nonlinear coding layers according to the order of the spectral channels. Each nonlinear coding layer performs both linear transformation and nonlinear activation operations, gradually reducing the dimensionality of the output features. For example, the number of input spectral channels can be compressed sequentially from 256 to 128, 64, and 32. This multi-layer compression process allows the single-point spectral branch to progressively extract the most critical spectral variation patterns in the normal material of the flexible hose composite material, while suppressing high-frequency noise and local perturbations in the spectrum that contribute little to material discrimination. At the end of the encoding process, the single-point spectral branch obtains a small-dimensional compressed spectral feature vector, which contains the main information of the average spectral sequence of the superpixel region. The industrial control computing unit then expands the compressed spectral feature vector layer by layer through multiple nonlinear decoding layers symmetrical to the encoding layer structure, restoring the feature dimension from 32 to 64, 128, and finally to the same number of spectral channels as the original average spectral sequence, ultimately generating a single-point reconstructed spectral sequence. For average spectral sequences from normal materials, the single-point spectral branch can achieve high-precision restoration through training, making the single-point reconstructed spectral sequence close to the input average spectral sequence in each spectral channel. However, for average spectral sequences with material anomalies or hybrid defects, the compressed spectral feature vector cannot fully represent the abnormal components, resulting in a significant difference between the decoded single-point reconstructed spectral sequence and the input average spectral sequence.
[0039] The axial neighborhood spectral branch is used to simultaneously consider the continuous material characteristics of flexible hose composite materials in the axial direction. When constructing the axial neighborhood spectral branch input, the industrial control computing unit uses multiple axially adjacent superpixel regions in a cylindrical coordinate system as a group of axial neighbors; for example, three or five adjacent superpixel regions can be selected. For this group of axial neighbors, the industrial control computing unit concatenates the average spectral sequences of each superpixel region in axial order to form an axial spectral neighborhood data block. When the axial spectral neighborhood data block contains three superpixel regions and each average spectral sequence has 256 spectral channels, the axial spectral neighborhood data block contains a total of 768 values. The industrial control computing unit inputs the axial spectral neighborhood data block into a one-dimensional convolutional coding layer, sliding the convolution kernel with a fixed stride in the axial direction. The convolution operation extracts similar variations and slow changing trends across different spectral bands within the axial neighborhood. The result of the convolution operation is further compressed through a set of nonlinear transform layers to form an axially compressed spectral feature vector. In this way, the axial neighborhood spectral branch can learn the spectral variation patterns of the flexible hose composite material within continuous axial segments. For example, under normal conditions, the spectral curve of a certain material changes little over long axial segments, but the shape of the axial spectral neighborhood data block changes significantly when inclusions or process fluctuations occur. The industrial control computing unit then uses a combination of a one-dimensional deconvolution decoding layer and a nonlinear decoding layer to inversely expand the axial compressed spectral feature vector, restoring it to an axial reconstructed spectral sequence containing 3 or 5 positions, each position corresponding to a reconstructed spectral sequence of a superpixel region. For normal axial segments, the axial neighborhood spectral branch can recover the average spectral sequence at each position relatively well; once the material of some superpixel regions in the axial segment changes, the recovery of the axial reconstructed spectral sequence at these positions deteriorates, manifested as a significant increase in the difference between the input average spectral sequence and the axial reconstructed spectral sequence.
[0040] When training the cylindrical unfolded hyperspectral dual-branch depth autoencoder model, the industrial control computing unit selects a flexible flexible tube composite material sample that has been manually verified as qualified. Using the first part of steps one and two, it obtains the spectrally normalized cylindrical unfolded hyperspectral image, superpixel region segmentation results, and average spectral sequence. For each training superpixel region, the industrial control computing unit inputs its average spectral sequence into a single-point spectral branch to obtain a single-point reconstructed spectral sequence. Simultaneously, it selects superpixel regions adjacent to this superpixel region in the axial direction to form an axial spectral neighborhood data block, and inputs this block into the axial neighborhood spectral branch to obtain an axial reconstructed spectral sequence. The industrial control computing unit calculates the absolute value of the difference between the average spectral sequence and the single-point reconstructed spectral sequence in each spectral channel, and takes the arithmetic mean across all spectral channels to obtain a single-point reconstruction difference index. Similarly, it calculates the absolute value of the difference between the reconstructed spectral sequences at corresponding positions in the average spectral sequence and the axial reconstructed spectral sequence in each spectral channel, and takes the arithmetic mean to obtain the axial reconstruction difference index. The industrial control computing unit adds the single-point reconstruction difference index to the axial reconstruction difference index to obtain the total reconstruction difference index, which is used as a numerical criterion to measure whether the current network parameters can accurately reconstruct normal materials. Through backpropagation and parameter updates, the industrial control computing unit continuously adjusts the network parameters of each encoding and decoding layer in the cylindrical unfolded hyperspectral dual-branch deep autoencoder model across multiple sample rounds, so that the total reconstruction difference index of the training samples gradually decreases and the change range is below a preset threshold in several consecutive rounds. At this point, it is considered that the cylindrical unfolded hyperspectral dual-branch deep autoencoder model has a stable representation capability for normal flexible hose composite materials.
[0041] During the actual operation of the production line, the network parameters of the cylindrical unfolded hyperspectral dual-branch deep autoencoder model remain unchanged. The industrial control computing unit performs spectral normalization and superpixel region division on each online cylindrical unfolded hyperspectral image in the same manner, and calculates the average spectral sequence for each superpixel region. The industrial control computing unit inputs the average spectral sequence into the cylindrical unfolded hyperspectral dual-branch deep autoencoder model sequentially to obtain the corresponding single-point reconstructed spectral sequence and axial reconstructed spectral sequence, and calculates the single-point reconstruction difference index, axial reconstruction difference index, and online total reconstruction difference index in the same manner as in the training phase. Based on the axial and circumferential positions of the superpixel regions in the cylindrical unfolded coordinate system, the industrial control computing unit organizes the online total reconstruction difference index into a two-dimensional matrix, forming an online reconstruction difference index map. Each element of the online reconstruction difference index map corresponds to the online total reconstruction difference index value of a specific superpixel region in the cylindrical unfolded hyperspectral image. The larger the value, the more significant the deviation of the spectral characteristics of the superpixel region from the normal material spectral mode learned by the cylindrical unfolded hyperspectral dual-branch deep autoencoder model.
[0042] To automatically determine the online reconstruction difference segmentation threshold from the total online reconstruction difference index, the industrial control computing unit statistically analyzes all values in the online reconstruction difference index graph to construct a frequency distribution histogram of the reconstruction difference index. Typically, most areas of the flexible hose composite material are of normal material, with only a few areas exhibiting defects or anomalies. Therefore, the total online reconstruction difference index shows a high-frequency concentrated distribution near smaller values and a low-frequency tail distribution near larger values. The industrial control computing unit can divide the numerical range of the total online reconstruction difference index into several continuous numerical intervals, such as 100 equal-width intervals, and count the frequency of the total online reconstruction difference index within each numerical interval to obtain a frequency distribution curve. The highest continuous numerical interval in the frequency distribution curve corresponds to the reconstruction difference index of a large number of normal material superpixel areas. The industrial control computing unit determines this continuous numerical interval as the normal material reconstruction difference interval and selects a value within a numerical interval above the upper bound of the normal material reconstruction difference interval as the online reconstruction difference segmentation threshold. When selecting this value, the industrial control computing unit can ensure that the proportion of superpixel regions below the online reconstruction difference segmentation threshold is close to a preset ratio, such as 95%. This ensures that most normal material superpixel regions are not misjudged as abnormal, while marking a few superpixel regions with significantly larger reconstruction difference indices as spectral anomaly superpixel regions. In another optional implementation, the industrial control computing unit can pre-calculate the typical frequency distribution of the total online reconstruction difference index based on multiple batches of normal production data, and use a fixed online reconstruction difference segmentation threshold during online operation. Alternatively, it can overlay the frequency distribution information of the current batch onto the fixed threshold, making small-range adaptive adjustments to the threshold, thus balancing long-term stability with adaptability to changes in operating conditions.
[0043] After determining the online reconstruction difference segmentation threshold, the industrial control computing unit traverses each element in the online reconstruction difference index map, marking superpixel regions with an online total reconstruction difference index not lower than the online reconstruction difference segmentation threshold as spectral anomalous superpixel regions, and generating a set of spectral anomalous superpixel regions. Subsequently, based on the relative positions of the superpixel regions in the cylindrical unfolded coordinate system, the industrial control computing unit determines whether the spectral anomalous superpixel regions are adjacent, where the adjacency relationship can be defined as having a shared boundary or shared vertex in the axial or circumferential unfolding direction. When two or more spectral anomalous superpixel regions satisfy the adjacency relationship, the industrial control computing unit merges them into the same connected region, and traverses the entire cylindrical unfolded hyperspectral image through connectivity analysis, merging all interconnected spectral anomalous superpixel regions into a single spectral anomalous candidate region, until no new adjacent merging occurs. Finally, the industrial control computing unit obtains a set of spectral anomaly candidate regions composed of multiple spectral anomaly candidate regions. Each spectral anomaly candidate region has a clear axial position range and circumferential position range in the cylindrical unfolded coordinate system, and corresponds to a set of superpixel regions with significantly larger reconstruction difference indices. This provides a basis for generating an initial set of geometric candidate defect regions on the actual surface of the flexible hose composite material.
[0044] After obtaining the set of candidate regions for spectral anomalies, the industrial control computing unit first maps the set of candidate regions from the cylindrical unfolded coordinate system to the actual surface of the flexible hose composite material using the geometric space coordinate system of the flexible hose composite material, thereby generating an initial set of candidate geometric defect regions. Each candidate region for spectral anomalies is a connected region described by axial position index range and circumferential position index range in the cylindrical unfolded coordinate system. The industrial control computing unit reads the minimum axial position index, maximum axial position index, minimum circumferential position index, and maximum circumferential position index of the candidate region for spectral anomalies in the cylindrical unfolded coordinate system, and converts these index values into the actual axial position range and actual circumferential position range on the outer surface of the flexible hose composite material according to the geometric space coordinate system of the flexible hose composite material established in step one. For example, when the axial position index range corresponds to the axial position interval of 500 mm to 520 mm in the conveying direction of the flexible hose composite material, and the circumferential position index range corresponds to the circumferential angle interval of 90 degrees to 140 degrees on the circumference of the flexible hose composite material, the industrial control computing unit defines this spatial range as an initial candidate geometric defect region. By performing a similar mapping operation on all spectral anomaly candidate regions in the spectral anomaly candidate region set, an initial set of geometric candidate defect regions covering the actual surface of the flexible hose composite material can be obtained. The advantage of this approach is that the spectral anomaly candidate regions are obtained in the image coordinate system of the cylindrical unfolded hyperspectral image, while the actual online marking and removal operations are performed on the flexible hose composite material itself. Only by mapping the defect regions in the image coordinate system to the geometric space coordinate system of the flexible hose composite material can a spatial location description that can be directly used by the actuator be provided.
[0045] After generating the initial set of candidate geometric defect regions, the industrial control computing unit extracts a local image patch from the corresponding cylindrical unfolded hyperspectral image for each candidate region. The axial and circumferential extent of this local image patch is slightly larger than the axial and circumferential position index ranges of the initial candidate defect region, for example, extending forward and backward by 10 rows in the axial direction and extending left and right by 5 columns in the circumferential unfolding direction. By appropriately expanding the local image patch, the edges of the initial candidate defect regions can be avoided from being truncated, thus providing a complete context region for subsequent image segmentation. The industrial control computing unit selects a brightness channel and a preset key spectral channel from the local image patch, combining these two channels into a two-dimensional grayscale image according to predetermined weighting coefficients. The brightness channel generally reflects the overall brightness variation of the flexible hose composite material surface structure, while the preset key spectral channel selects wavelengths where the difference in reflection intensity between normal materials and typical defects is significant. For example, in rubber-based flexible hose composite materials, the reflection intensity of the normal material at a certain near-infrared wavelength is significantly lower than that of the inclusion material. Therefore, the grayscale contrast between the defect area and the background area is higher in this wavelength channel. Using this spectral channel as a preset key spectral channel can enhance the grayscale difference between the defect area and the surrounding area, making it easier for subsequent threshold segmentation to separate the defect area from the background. The weighted combination of the brightness channel and the preset key spectral channel preserves the spatial information of the surface texture while emphasizing locations with significant spectral differences, thus forming a more sensitive two-dimensional grayscale image for defects.
[0046] After obtaining a two-dimensional grayscale image representing the initial geometric candidate defect region, the industrial control computing unit performs image segmentation on this grayscale image to generate an initial binary defect mask. Specifically, the industrial control computing unit statistically analyzes the grayscale value distribution of all pixels in the two-dimensional grayscale image, constructs a grayscale histogram, and observes the number of pixels in different grayscale intervals within the histogram. Typically, the local image block containing the initial geometric candidate defect region includes the defect region and a small amount of normal background region. The grayscale values of the defect region in the two-dimensional grayscale image are concentrated on one side (higher or lower), while the grayscale values of the normal background region are concentrated on the other side. Therefore, two distinct grayscale concentration regions can usually be observed in the grayscale histogram. The industrial control computing unit can select a fixed grayscale value as a threshold between the two grayscale concentration regions. When the grayscale value of a pixel in the two-dimensional grayscale image is greater than the threshold, the pixel is marked as a foreground pixel; otherwise, it is marked as a background pixel, forming the initial binary defect mask. This threshold selection method can, in most cases, classify regions with significantly different spectral characteristics from normal materials as foreground, which is beneficial for including potential defect regions within the range of the initial binary defect mask. If multiple peaks exist in the local grayscale histogram and the differences between the peaks are not significant, the industrial control computing unit can use an automatic threshold selection method based on inter-class variance. This method automatically obtains the grayscale threshold that maximizes the distinction between foreground and background classes without relying on manual threshold setting, thereby generating a more stable initial binary defect mask. In scenarios requiring improved robustness, the same threshold can be applied to adjacent frames based on this fixed threshold, ensuring consistent segmentation results for the same segment of flexible hose composite material across connected frames.
[0047] Initial binary defect masks typically contain isolated noise points or fragmented areas with uneven boundaries, thus requiring morphological processing to obtain a stable defect region mask. The industrial control computing unit first performs a morphological dilation operation on the initial binary defect mask. This operation expands the foreground region around each foreground pixel using structuring elements of predetermined shape and size, filling gaps between closely spaced foreground pixel blocks. For example, a rectangular structuring element with a width of 3 pixels in the axial direction and a circumferential expansion direction can be used to dilate the initial binary defect mask. This allows small cracks or discontinuous defect regions with a width of less than 3 pixels to form a continuous region after dilation, preventing the real defect from being incorrectly segmented into multiple separate small blocks. After dilation, the industrial control computing unit performs a morphological erosion operation on the dilation result, using structuring elements of the same size as those used in the dilation operation to shrink the boundaries of the foreground region inward. This appropriately recovers the excessive expansion generated during the dilation process, thereby essentially restoring the true contour of the defect region while filling small internal voids. This combined operation of expansion and erosion is equivalent to performing a morphological closing operation on the initial binary defect mask, which can effectively improve the connectivity inside the defect region and eliminate narrow discontinuities.
[0048] To further remove isolated small noise points and smooth the boundaries of stable defect region masks, the industrial control computing unit can continue to perform morphological opening operations and boundary smoothing on the binary image that has already undergone dilation and erosion processing. Morphological opening operations typically consist of one erosion operation and one dilation operation. By first eroding and then dilating, small foreground regions with areas smaller than the coverage area of the structuring element are removed while maintaining the overall shape of the large foreground region. For example, if the coverage area of the structuring element is set to 9 pixels, then after performing the opening operation, isolated foreground points with areas smaller than 9 pixels in the initial binary defect mask will be completely removed. This processing can eliminate isolated bright spots caused by sensor noise, uneven local illumination, and other factors. Boundary smoothing can be achieved by locally averaging the boundary curves of stable defect regions or by alternating small-scale dilation and erosion operations. This makes the originally jagged boundaries with sharp protrusions and depressions smoother, facilitating subsequent calculations of the size and shape parameters of stable defect regions and improving visual interpretability. After the above morphological processing, the industrial control computing unit obtains a stable defect region mask. The foreground region in the mask is spatially continuous and has clear boundaries, which can accurately cover the actual defect region on the surface of the flexible hose composite material.
[0049] refer to Figure 2This document demonstrates the morphological processing workflow, including visualizations of the four processing stages and explanations of the processing parameters. The workflow performs a series of morphological operations on an initial binary defect mask to remove noise points and obtain stable defect region contours. The initial binary mask is the input image for morphological processing, with a size of 150×150 pixels. A white background represents normal areas, and black areas represent potential defects. The initial mask contains multiple scattered black areas: a 40×35 pixel primary defect region located at coordinates (20,30), a 15×20 pixel secondary defect region at coordinates (65,40), a 30×40 pixel defect region at coordinates (90,80), and multiple isolated noise points with an area less than 25 square pixels. These scattered areas reflect the original detection results after thresholding, exhibiting regional discontinuities and noise interference. The dilation process uses a 3×3 rectangular structuring element to perform morphological dilation operations on the initial binary mask. The dilation operation expands each black pixel outwards, with the expansion range determined by the size of the structuring element. After dilation, previously separate adjacent defect regions are connected; for example, the two regions at coordinates (20,30) and (30,70) are merged into a single 50×45 pixel connected region. The dilation operation fills small voids within the defects, enhancing regional connectivity. The erosion operation, based on the dilation result, performs a morphological erosion operation using the same 3×3 rectangular structuring element. The erosion operation shrinks inward from the boundary of the black region, with a shrinkage degree comparable to the dilation degree. The combination of dilation and erosion constitutes a morphological closing operation, maintaining the basic shape of the defect region while connecting adjacent regions and filling internal voids. The closing operation results in two main connected regions: a 45×40 pixel region at coordinates (20,30) and a 35×45 pixel region at coordinates (90,80). The opening operation performs a morphological opening operation on the closing operation result, i.e., a combination of erosion and dilation. The opening operation can break small connections and remove isolated regions with an area smaller than the coverage area of the structuring element. After the opening operation, noise points with an area smaller than 9 pixels were completely removed, retaining the two main defect regions with smoothed and regular contours. The stable defect mask is the final output of the morphological processing, containing two independent rectangular defect regions, marked with red dashed boxes. The first defect region is located at coordinates (25, 35) and has a size of 40 × 35 pixels; the second defect region is located at coordinates (90, 80) and has a size of 35 × 45 pixels. These two regions are the stable defects identified by the detection system, and their position parameters will be used for subsequent defect localization and actuator control. The morphological processing parameter box details the various operational parameters: the expansion kernel, erosion kernel, and opening kernel all use 3 × 3 rectangular structural elements; the area threshold is set to 9 pixels, and areas smaller than this threshold are considered noise; connectivity is determined using the 8-neighborhood criterion; boundary smoothing is achieved through 3 iterations. The selection of these parameters balances noise suppression capability and defect preservation capability.
[0050] After acquiring the mask of the stable defect region, the industrial control computing unit extracts the position parameters of each stable defect region using the geometric space coordinate system of the flexible hose composite material, thereby forming the defect localization result. Specifically, the industrial control computing unit first maps the axial position index range and circumferential position index range of each stable defect region in the cylindrical unfolded coordinate system back to the geometric space coordinate system, obtaining the start and end positions of the stable defect region along the axial direction of the flexible hose composite material, as well as the start and end positions along the circumferential direction of the flexible hose composite material. The start and end positions in the axial direction can be obtained by combining the minimum and maximum axial position indices of the stable defect region in the cylindrical unfolded hyperspectral image with the conversion relationship between the axial row index and the actual axial position in step one. For example, when the actual axial position corresponding to the minimum axial position index is 3.5 meters and the actual axial position corresponding to the maximum axial position index is 3.7 meters, the length of the stable defect region along the axial direction of the flexible hose composite material is approximately 0.2 meters. The starting and ending positions in the circumferential direction can be converted into circumferential angle ranges by combining the minimum and maximum circumferential position indices of the stable defect region in the cylindrical unfolded hyperspectral image, and the relationship between the circumferential length of the flexible hose composite material and the number of circumferential sampling points. For example, when the circumferential position index range corresponds to 120 degrees to 180 degrees, it indicates that the stable defect region is located on a one-sixth arc segment on the outer circumference of the flexible hose composite material.
[0051] After obtaining the axial and circumferential position ranges of the stable defect area, the industrial control computing unit (ICU) needs to determine the corresponding actuator trigger positions. This allows the production line actuators to perform online marking, online rejection, or online grading when the defect area reaches a designated position. To this end, the ICU converts the axial start and end positions of the stable defect area into corresponding axial position pulse value ranges based on the conversion relationship between the cumulative axial position pulse value of the production line's synchronous encoder and the actual axial position of the flexible hose composite material. Then, based on the fixed spatial position of the actuators in the production line's conveying direction, it deduces the axial position pulse value that the ICU needs to issue a trigger signal before the stable defect area reaches the actuator's position. For example, when the actuator is installed 10 meters from the axial zero point of the geometric coordinate system, and the axial start position of a certain stable defect area is 8 meters, the ICU, based on the correspondence between axial position pulses and axial displacement, records the defect area identifier when the cumulative axial position pulse value reaches the corresponding 8-meter position, and sends a trigger signal to the actuator when the cumulative axial position pulse value approaches the corresponding 10-meter position. This ensures that the actuator operates when the stable defect area passes through its working area.
[0052] In one optional implementation, to improve the safety margin of defect handling, the industrial control computing unit can add a buffer zone of a certain length in the axial direction for each stable defect region when calculating the trigger position of the actuator. For example, it can add a 0.05-meter advance before the axial start position of the stable defect region and a 0.05-meter delay after the axial end position, and calculate the actuator trigger position based on the expanded position interval. In this way, when there are small fluctuations in the production line conveyor speed or small cumulative errors in the axial position pulses of the production line synchronous encoder, the actuator can still complete the action when passing through the stable defect region without missing the defect region. In addition, for stable defect regions with a long axial length, the industrial control computing unit can also divide them into multiple adjacent execution segments and calculate the actuator trigger position for each execution segment separately, so that the actuator can gradually eliminate or mark the entire defect region using a segmented processing method. Through the above-mentioned position parameter extraction and actuator trigger position calculation, the industrial control computing unit transforms the spatial information in the stable defect region mask into a defect location result that can be directly executed on the flexible hose composite material production line, thereby realizing the closed-loop application of online visual inspection and defect location methods in the actual production environment.
[0053] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An online visual inspection and defect location method for a flexible hose composite material production line, characterized in that, Includes the following steps: Step 1: Linear array hyperspectral cameras and production line synchronous encoders are arranged along the conveying direction on the flexible hose composite material production line. Under the trigger control of the production line synchronous encoder, the linear array hyperspectral camera acquires multi-channel spectral linear array images in the axial direction. The industrial control computing unit performs cylindrical unfolding resampling based on the axial position pulse signal provided by the production line synchronous encoder, the pre-calibrated outer diameter information of the flexible hose composite material, the installation geometric relationship between the optical axis of the linear array hyperspectral camera and the central axis of the flexible hose composite material, and the axial displacement interval between adjacent triggering times of the linear array hyperspectral camera. The spectral linear array is combined into a cylindrical unfolded hyperspectral image sequence and arranged into a spectral space data cube to establish the geometric space coordinate system of the flexible hose composite material. Step 2: Construct a cylindrical unfolded hyperspectral dual-branch deep autoencoder model, perform spectral normalization and superpixel region segmentation on the cylindrical unfolded hyperspectral image, input the average spectral sequence of the superpixel region into the cylindrical unfolded hyperspectral dual-branch deep autoencoder model to obtain the reconstructed spectral sequence, calculate the reconstruction difference index, determine the online reconstruction difference segmentation threshold based on the frequency distribution of the reconstruction difference index, mark the superpixel region with the reconstruction difference index not lower than the online reconstruction difference segmentation threshold as the spectral anomalous superpixel region, and merge adjacent spectral anomalous superpixel regions to obtain the spectral anomalous candidate region set; Step 3: Map the spectral anomaly candidate regions onto the actual surface of the flexible hose composite material to generate an initial set of geometric candidate defect regions. Perform image segmentation and morphological processing on the initial geometric candidate defect regions to obtain a stable defect region mask. Extract the positional parameters of the stable defect regions as the defect localization results.
2. The method according to claim 1, characterized in that, In step one, the industrial control computing unit combines the spectral linear array around the entire circumference of the flexible hose composite material into a cylindrical unfolded hyperspectral image sequence with the axial and circumferential unfolding directions as planes. Within the industrial control computing unit, the cylindrical unfolded hyperspectral image sequence is arranged into a spectral space data cube in the spectral channel direction, axial direction, and circumferential unfolding direction. The geometric space coordinate system of the flexible hose composite material is established by the cumulative axial position pulse of the production line synchronous encoder and the row and column index of the cylindrical unfolded hyperspectral image, so that the axial position, circumferential position and actual position of each pixel in the spectral space data cube on the flexible hose composite material in the production line conveying direction have a one-to-one correspondence.
3. The method according to claim 1, characterized in that, Step 2, the superpixel region segmentation adopts a region growing method, which specifically includes: using a number of spaced pixels as seed pixels, merging pixels adjacent to the seed pixels and whose reflection intensity differences in all spectral channels are within a preset similarity range into the same superpixel region, and continuously expanding to adjacent pixels until the spectral difference between adjacent pixels exceeds the preset similarity range or the superpixel region reaches the preset area limit, forming a superpixel region segmentation result that covers the entire cylindrical unfolded hyperspectral image.
4. The method according to claim 1, characterized in that, The cylindrical unfolded hyperspectral dual-branch deep autoencoder model in step two includes two encoding and decoding paths: a single-point spectral branch and an axial neighborhood spectral branch. The single-point spectral branch takes the average spectral sequence of a single superpixel region as input, and sequentially passes through multiple fully connected encoding layers to reduce the spectral channel dimension layer by layer to form a compressed spectral feature vector. Then, it passes through multiple fully connected decoding layers symmetrical to the encoding layer structure to restore the compressed spectral feature vector to the reconstructed spectral sequence. The axial neighborhood spectral branch takes the average spectral sequence of three superpixel regions adjacent along the axial direction in the cylindrical unfolded coordinate system as input, and concatenates the three average spectral sequences in axial order to form an axial spectral neighborhood block. A one-dimensional convolutional encoding layer performs sliding convolution on the axial spectral neighborhood block in the axial direction to extract axial variation features, and then a fully connected layer compresses the convolution result into an axial compressed spectral feature vector. Finally, a combination of a one-dimensional deconvolutional decoding layer and a fully connected decoding layer restores the axial compressed spectral feature vector to the axial reconstructed spectral sequence corresponding to the three positions.
5. The method according to claim 1 or 4, characterized in that, In step two, the industrial control computing unit inputs the average spectral sequence of each superpixel region in the training sample set into the single-point spectral branch and the axial neighborhood spectral branch respectively during the training phase to obtain the single-point reconstructed spectral sequence and the axial reconstructed spectral sequence. By averaging the absolute values of the channel differences between the input average spectral sequence and the single-point reconstructed spectral sequence, and averaging the absolute values of the channel differences between the corresponding reconstructed spectral sequences in the input average spectral sequence and the axial reconstructed spectral sequence, the single-point reconstruction difference index and the axial reconstruction difference index are calculated. The sum of the two types of reconstruction difference indices is taken as the total reconstruction difference index of the training sample. The network parameters of the cylindrical unfolded hyperspectral dual-branch deep autoencoder model are adjusted by gradient descent so that the total reconstruction difference index of the training sample gradually decreases until the change range is stable within the preset training rounds.
6. The method according to claim 1, characterized in that, In step two, during the formal operation of the production line, the industrial control computing unit generates an online cylindrical unfolded hyperspectral image for each spectral space data cube using a cylindrical unfolding method. It uses the same spectral normalization preprocessing and superpixel region construction method as in the training phase to generate an online superpixel region set. For each superpixel region in the online superpixel region set, it calculates the average spectral sequence and inputs it into the trained cylindrical unfolded hyperspectral dual-branch deep autoencoder model to obtain the corresponding single-point reconstruction spectral sequence and axial reconstruction spectral sequence. It calculates the single-point reconstruction difference index and axial reconstruction difference index for each superpixel region, adds them together to form the online total reconstruction difference index, and fills all the online total reconstruction difference indices into the online reconstruction difference index map according to the axial and circumferential positions of the superpixel regions in the cylindrical unfolded coordinate system.
7. The method according to claim 6, characterized in that, The industrial control computing unit reads all online total reconstruction difference indicators from the online reconstruction difference index map, statistically analyzes the frequency distribution of the online total reconstruction difference indicators, selects the continuous online total reconstruction difference index interval with the highest frequency as the normal material reconstruction difference interval, selects an online reconstruction difference segmentation threshold within an online total reconstruction difference index interval outside the upper boundary of the normal material reconstruction difference interval, marks the superpixel regions with online total reconstruction difference indicators not lower than the online reconstruction difference segmentation threshold as spectral anomalous superpixel regions, obtains a set of spectral anomalous superpixel regions, and merges adjacent spectral anomalous superpixel regions in the cylindrical unfolded coordinate system according to the connectivity of the spectral anomalous superpixel regions in the axial and circumferential unfolded directions, obtains a set of spectral anomalous candidate regions.
8. The method according to claim 1, characterized in that, In step two, the industrial control computing unit calls the cylindrical unfolded hyperspectral dual-branch depth autoencoder training module during the equipment installation and debugging phase. Multiple spectral spatial data cubes are collected from the flexible hose composite material sample that has been manually confirmed as qualified. The same cylindrical unfolding method as in step one is used to generate a training cylindrical unfolded hyperspectral image sequence. For each cylindrical unfolded hyperspectral image in the training cylindrical unfolded hyperspectral image sequence, the industrial control computing unit performs dark current correction and reflection intensity normalization processing on each spectral channel according to the spectral channel order to obtain a spectrally normalized cylindrical unfolded hyperspectral image.
9. The method according to claim 1, characterized in that, In step three, the industrial control computing unit maps the axial and circumferential position indices of each spectral anomaly candidate region in the spectral anomaly candidate region set to the actual surface of the flexible hose composite material through the geometric space coordinate system of the flexible hose composite material established in step one, generating a corresponding initial geometric candidate defect region set. For each initial geometric candidate defect region, a brightness channel and a preset key spectral channel are selected in the original cylindrical unfolded hyperspectral image to form a two-dimensional grayscale image. The industrial control computing unit performs fixed threshold segmentation on the two-dimensional grayscale image to obtain an initial binary defect mask.
10. The method according to claim 9, characterized in that, The industrial control computing unit sequentially performs morphological dilation and morphological erosion operations on the initial binary defect mask to eliminate isolated small noise points and make the boundaries of the real defect region coherent. Then, it performs morphological opening and boundary smoothing operations on the binary defect mask after dilation and erosion to obtain a stable defect region mask. The stable defect region mask is mapped back to the geometric space coordinate system of the flexible hose composite material. The starting and ending positions of each stable defect region along the axial direction, the starting and ending positions along the circumferential direction, and the corresponding actuator trigger positions in the production line conveying direction are extracted. The industrial control computing unit sends these position parameters and the contour information of the stable defect region in the cylindrical unfolded coordinate system as the defect location result to the production line actuator for online marking, rejection, or classification of defect segments of the flexible hose composite material.