Rubber plug surface defect image recognition method and system based on deep learning
Patent Information
- Application Number
- CN202611143354.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]本发明提供了一种基于深度学习的胶塞表面缺陷图像识别方法及系统,以解决现有检测系统在高速涂硅产线中,因机械设备振动导致图像空间偏移,同时表面硅油反光造成图像特征断层,且系统在面临胶塞受夹持挤压产生的物理拉伸形变时缺乏抗干扰机制,致使反光噪声、正常拉伸形变与真实裂纹特征发生混叠,最终导致缺陷识别误检率与漏检率升高的技术问题
[0026]通过将多偏振态时序图像张量转换至频域,基于加速度序列提取极点坐标并构建带阻掩码执行掩码操作,在图像预处理阶段滤除了机械高频振动引发的特定方向运动拖影,为后续的特征提取提供了空间坐标对齐的物理基准。
Smart Images

Figure CN123015934A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision technology, and in particular to a method and system for image recognition of surface defects in rubber stoppers based on deep learning. Background Technology
[0002] Current technologies for detecting surface defects in rubber stoppers typically employ a combination of machine vision and deep learning networks. However, in actual high-speed silicone coating mass production lines, the inspection environment faces multiple sources of physical interference. First, the high-frequency mechanical vibrations of the conveyor can cause physical spatial shifts and blurring in the time-series images captured by the camera. Second, the silicone oil layer coated on the rubber stopper surface produces anisotropic specular reflections under light illumination, which can easily obscure the true physical morphology of the underlying material in the image space. When traditional static feature extraction algorithms process such images, they are highly prone to misidentifying reflective highlights as surface defects.
[0003] Furthermore, in the subsequent defect geometry analysis stage, due to the inherent flexibility of the butyl rubber material, the rubber stopper undergoes irregular tensile deformation under stress when gripped by mechanical claws or squeezed by guide rails. Existing defect detection systems lack anti-interference mechanisms for the tensile deformation of flexible materials, directly inputting image features containing reflective highlights and physical tensile deformation into the deep learning network. Reflective noise, normal tensile deformation, and real crack defects overlap at the data layer, increasing the difficulty of feature extraction for the defect classification network, ultimately resulting in a high false detection rate and false negative rate on industrial production lines. Summary of the Invention
[0004] This invention provides a deep learning-based image recognition method and system for rubber stopper surfaces to solve the technical problems of existing detection systems in high-speed silicone coating production lines. These problems include image spatial shift caused by mechanical equipment vibration, image feature fragmentation caused by surface silicone oil reflection, and the lack of anti-interference mechanism when the system faces physical tensile deformation caused by the clamping and squeezing of rubber stoppers. As a result, reflective noise, normal tensile deformation and real crack features are mixed, ultimately leading to an increased false detection rate and false negative rate in defect recognition.
[0005] In view of the above problems, the present invention provides a method for image recognition of surface defects of rubber stoppers based on deep learning, comprising the following steps:
[0006] Receive displacement pulse signals and acceleration sequences from the conveying device, and extract the motion phase;
[0007] When the motion phase is within a preset phase range, a first trigger signal is generated;
[0008] Based on the first trigger signal, acquire the multi-polarization state temporal image tensor of the object under test;
[0009] The multi-polarization state time-series image tensor is transformed to the two-dimensional spatial frequency domain to obtain frequency domain feature components, and a band-stop mask is generated based on the acceleration sequence.
[0010] The band-stop mask and the frequency domain feature components are masked, and the aligned image sequence is output after inverse Fourier transform.
[0011] Based on the aligned image sequence, the polarization divergence index of each pixel coordinate is calculated;
[0012] For any target pixel coordinate among the pixel coordinates, if the polarization divergence index of the target pixel coordinate is greater than a preset polarization threshold, the feature component corresponding to the target pixel coordinate in the aligned image sequence is set to zero.
[0013] The aligned image sequence after the zeroing operation is fused along the temporal dimension to output a topological base map tensor;
[0014] Extract the edge contours from the topological base map tensor, and calculate the curvature continuity derivative of the edge contours based on the arc length parameter;
[0015] If the curvature continuity derivative is greater than the preset distortion constant, a singular point mask is generated at the pixel coordinate position corresponding to the edge contour.
[0016] The topology tensor is concatenated with the singularity mask, input into a preset defect classification network model, and the defect confidence vector is output.
[0017] This invention provides a deep learning-based image recognition system for rubber stopper surface defects, comprising:
[0018] Sensing trigger unit: used to receive displacement pulse signals and acceleration sequences from the conveying device, extract motion phase; when the motion phase is within a preset phase range, generate a first trigger signal; acquire multi-polarization state time-series image tensors of the object under test based on the first trigger signal;
[0019] Frequency domain alignment unit: used to transform the multi-polarization state time-series image tensor to the two-dimensional spatial frequency domain, obtain frequency domain feature components, and generate a band-stop mask based on the acceleration sequence; perform a masking operation on the band-stop mask and the frequency domain feature components, and output an aligned image sequence after inverse Fourier transform;
[0020] Polarization truncation unit: used to calculate the polarization divergence index of each pixel coordinate based on the aligned image sequence; for any target pixel coordinate in the pixel coordinates, if the polarization divergence index of the target pixel coordinate is greater than a preset polarization threshold, the feature component corresponding to the target pixel coordinate in the aligned image sequence is zeroed; the aligned image sequence after the zeroing operation is fused along the temporal dimension to output a topological base map tensor;
[0021] Continuity extraction unit: used to extract edge contours in the topological base map tensor, calculate the curvature continuity derivative of the edge contours based on the arc length parameter; if the curvature continuity derivative is greater than a preset distortion constant, generate a singular point mask at the pixel coordinate position corresponding to the edge contour;
[0022] Classification output unit: used to concatenate the topology map tensor with the singular point mask, input a preset defect classification network model, and output a defect confidence vector.
[0023] The present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the above-described deep learning-based image recognition method for rubber stopper surface defects.
[0024] The present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described deep learning-based image recognition method for rubber stopper surface defects.
[0025] The technical solution provided in this application has at least the following technical effects:
[0026] By transforming the tensor of multi-polarization temporal images to the frequency domain, the pole coordinates are extracted based on the acceleration sequence and a band-stop mask is constructed to perform a masking operation. In the image preprocessing stage, the motion trailing shadows in specific directions caused by high-frequency mechanical vibrations are filtered out, providing a physical benchmark for spatial coordinate alignment for subsequent feature extraction.
[0027] The polarization divergence index is obtained by calculating the variance of the brightness component of the same pixel coordinate under different polarization time frames. The polarization divergence index is then compared and truncated with a preset polarization threshold calculated based on the refractive index of the coating and the refractive index of the substrate. This process eliminates specular highlight reflection signals generated by the silicone oil layer and extracts the topological map tensor that excludes light field interference.
[0028] By calculating the curvature continuity derivative of the edge contour and generating a singular point mask using a nonlinear activation function configured with a relaxation adjustment factor and a distortion constant, the normal elastic tensile deformation features below the target deformation threshold are converged and suppressed at the mathematical output. This immunizes against interference caused by clamping force deformation before classification and inference, thereby reducing the false detection rate and false negative rate of defect identification in industrial fields. Attached Figure Description
[0029] Figure 1 A flowchart of a deep learning-based image recognition method for rubber stopper surfaces provided in an embodiment of the present invention;
[0030] Figure 2 This is a diagram illustrating the architecture of a deep learning-based image recognition system for rubber stopper surfaces, provided in an embodiment of the present invention. Detailed Implementation
[0031] The above technical solutions will now be described in detail with reference to the accompanying drawings and specific embodiments to provide a better understanding of them. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. It should be understood that the present invention is not limited to the exemplary embodiments used only to explain the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention. Furthermore, it should be noted that, for ease of description, only the parts related to the present invention are shown in the drawings, not all of them.
[0032] Example: Please refer to Figure 1 and Figure 2 The conveying device uses a rotary dial or linear motor as its physical support base. A triaxial accelerometer mounted on the base collects physical vibration frequencies and outputs acceleration sequences, while a high-precision encoder mounted on the conveying device's rotating shaft outputs displacement pulse signals. A programmable multi-polarization array light source and a multi-frame high-speed area array camera are orthogonally arranged above the conveying device in physical space. The triaxial accelerometer, high-precision encoder, programmable multi-polarization array light source, and multi-frame high-speed area array camera establish a microsecond-level clock handshake protocol through a hardware synchronization clock bus, forming a physical spatiotemporal reference topology for hardware-sensing the environment.
[0033] With the establishment of the physical spatiotemporal reference topology, the deep learning-based rubber stopper surface defect image recognition system executes decoupled flow logic sequentially. The sensing trigger unit acquires acceleration sequences and displacement pulse signals to extract motion phases, while the frequency domain alignment unit receives multi-polarization state time-series image tensors and performs band-stop masking operations in the two-dimensional spatial frequency domain. The polarization truncation unit calculates the polarization divergence index based on the aligned image sequence and outputs a topological map tensor. The continuity extraction unit calculates the curvature continuity derivative based on the topological map tensor to generate a singularity mask. The classification output unit inputs the topological map tensor and the singularity mask into a preset defect classification network model to complete the inference. The lack of a pre-alignment step between the sensing trigger unit and the frequency domain alignment unit will result in a physical spatial misalignment of the aligned image sequence on the time axis. The lack of an optical stripping step by the polarization truncation unit will cause the continuity extraction unit to diverge at the reflective step pixel position when performing curvature calculus differentiation.
[0034] The sensing trigger unit receives the displacement pulse signal and acceleration sequence output by the conveying device. It extracts the pulse rise edge timestamp of the displacement pulse signal and the instantaneous amplitude of the acceleration sequence. The sensing trigger unit calculates the time difference between adjacent pulse rise edge timestamps and, based on the ratio of the time difference to the total physical duration of a single cycle of the conveying device, calculates the basic phase angle of the current mechanical cycle. The sensing trigger unit extracts the instantaneous acceleration amplitude synchronized with the pulse rise edge timestamp and multiplies it by a preset phase compensation coefficient to obtain the phase offset. The sensing trigger unit performs an additive operation on the basic phase angle and the phase offset to generate a motion phase. When the motion phase is within a preset phase interval, the sensing trigger unit generates a first trigger signal. The preset phase interval is determined by setting upper and lower limits for the instantaneous amplitude of the acceleration sequence to avoid the mechanical oscillation range where the conveying device accelerates past the zero point. Along with the generation of the first trigger signal, it is sent to the programmable multi-polarization array light source and the multi-frame high-speed area array camera via a hardware interrupt channel. The multi-frame high-speed area array camera synchronously acquires multi-polarization temporal image tensors of the object under test based on the first trigger signal.
[0035] The frequency domain alignment unit extracts the multi-polarization temporal image tensor and acceleration sequence. It then uses the Discrete Fourier Transform algorithm to map the multi-polarization temporal image tensor to the two-dimensional frequency domain, obtaining frequency domain feature components. The unit inputs the acceleration sequence into a three-dimensional physical space coordinate system matrix and, combined with the camera's global shutter exposure time window, performs a second-order time integration operation on the acceleration sequence to generate a motion vector. This motion vector contains a magnitude representing physical displacement and a direction angle representing physical direction. The unit then uses the equivalent pixel size of the camera's imaging sensor, dividing the magnitude by the equivalent pixel size to generate the pixel displacement distance. Finally, the unit constructs a point spread function mathematical model based on a linear motion blur mechanism. It substitutes the horizontal and vertical pixel offset components into the point spread function mathematical model to calculate the point spread function energy distribution equation. This energy distribution equation defines the frequency domain integration boundary in the two-dimensional frequency domain.
[0036] After defining the frequency domain integration boundary, the frequency domain alignment unit retrieves and extracts the coordinates of poles falling within the frequency domain integration boundary in the two-dimensional spatial frequency domain matrix. The pole coordinates represent the high-frequency interference bands with concentrated energy caused by specific mechanical vibration frequencies in the image frequency distribution matrix. The frequency domain alignment unit constructs a band-stop mask matrix covering the pole coordinate region. The frequency domain alignment unit performs a Hadamard product calculation on the band-stop mask matrix and the frequency domain eigencomponent matrix in the two-dimensional spatial frequency domain, overwriting the frequency amplitude of the pole coordinate region with 0. Once the masking operation is complete, the frequency domain alignment unit performs an inverse discrete Fourier transform, outputting an aligned image sequence that eliminates directional motion artifacts. The aligned image sequence establishes a spatially unbiased physical mapping reference at the pixel coordinate array level, and serves as the data input source to trigger the polarization truncation unit to perform subsequent operations.
[0037] Along with the output of the frequency domain alignment unit, the aligned image sequence triggers the polarization truncation unit to execute the optical domain stripping logic. The polarization truncation unit extracts the feature component matrix of the same target pixel coordinates in the aligned image sequence under different time frames. Different time frames correspond to different polarization field excitation states output by the programmable multi-polarization array light source. The polarization truncation unit calculates the statistical variance of the brightness of each feature component within the feature component matrix. The statistical variance of the brightness of each feature component within the feature component matrix is defined as the polarization divergence index. In the physical optical projection mechanism, the interface microlens effect generated by silicone oil droplets forms anisotropic Fresnel specular reflection, causing the brightness of the feature components to fluctuate in different time frames and output a high-amplitude polarization divergence index; the interior of the physical defect forms isotropic diffuse reflection, outputting a low-amplitude polarization divergence index close to 0.
[0038] After obtaining the polarization divergence index, the polarization truncation unit performs a numerical comparison between the polarization divergence index and a preset polarization threshold. The refractive indices of the surface coating and the substrate material are physical constants of the medical silicone oil coating and butyl rubber material, respectively, obtained from the material's manufacturer's property parameter table. The polarization truncation unit substitutes the refractive indices of the surface coating and the substrate material into the Brewster angle mathematical equation to calculate the theoretical polarization reflection extremum. The polarization truncation unit substitutes the Fresnel reflection coefficient corresponding to the theoretical polarization reflection extremum into the brightness response model, and combines it with the photoelectric conversion gain parameters of the multi-frame high-speed area array camera to calculate and output a preset polarization threshold with dimensions consistent with the polarization divergence index. The preset polarization threshold establishes a quantitative judgment boundary at the physical level that distinguishes the specular highlights of optical mirrors from the topological structure of solid materials.
[0039] When the polarization divergence index of the target pixel coordinates determined by numerical comparison is greater than a preset polarization threshold, the polarization truncation unit performs a zero-setting truncation operation on the feature components. The polarization truncation unit overwrites the feature components corresponding to the target pixel coordinates in the aligned image sequence with 0, and removes the optical feature signals generated by the microlens effect at the interface layer of the tensor data. After performing the feature component zero-setting operation, the polarization truncation unit calls the average pooling algorithm to perform dimensionality reduction and fusion calculations along the temporal dimension of the aligned image sequence. The average pooling algorithm collapses the multi-frame temporal tensor into a single-layer two-dimensional spatial tensor along the time axis, generating and outputting a topology map tensor. As an alternative, the polarization truncation unit calls the maximum value aggregation algorithm instead of the average pooling algorithm to perform dimensionality reduction and fusion calculations, satisfying the engineering algorithm output conditions for generating a single-layer two-dimensional spatial tensor. The topology map tensor excludes interference data from the ambient light field, and the topology map tensor data stream triggers the continuity extraction unit to start the analysis process.
[0040] The continuity extraction unit receives the topological base map tensor and enters the force domain attribute constraint stage. The continuity extraction unit calls the gradient operator to perform differential operations on the two-dimensional spatial pixel matrix of the topological base map tensor, extracting regions of abrupt gradient changes in pixel grayscale values to generate edge contours. In application environments with limited microprocessor computing power, the continuity extraction unit calls the Cannibal operator instead of the gradient operator to perform sub-pixel-level coordinate extraction operations on the edge contours; the Cannibal operator outputs the geometric boundary feature structure. The continuity extraction unit obtains the discrete pixel coordinate set of the edge contours and performs geometric parameterization mapping on the discrete pixel coordinate set based on the curve arc length parameter. The continuity extraction unit constructs a geometric parametric equation with the curve arc length parameter as an independent variable, which transforms the discontinuous pixel matrix into a curve equation structure conforming to the topological geometric rules of a continuous medium.
[0041] Based on the established geometric parametric equations, the continuity extraction unit performs calculus calculations of the curvature continuity derivative. The continuity extraction unit performs second-order differentiation on the geometric parametric equations to calculate the local topological curvature, and then performs first-order differentiation on the local topological curvature with respect to the curve arc length parameter to generate the curvature continuity derivative. In the discrete digital computing architecture, the continuity extraction unit uses a difference accumulation approximation algorithm of adjacent sampled pixel coordinates to replace the differential operations of analytical geometry. This difference accumulation approximation algorithm outputs the curvature continuity derivative. In the physical mechanism of continuum mechanics, the curvature continuity derivative characterizes the boundary between the microscopic phase transition rate of elastic deformation and tearing faults. It serves as a criterion for identifying the algebraic computational dimension of non-affine deformation in a system.
[0042] The continuity extraction unit uses the following formula to calculate the value of the singularity mask:
[0043] in, This indicates the value of the singularity mask. The derivative of the curvature continuity is represented by the derivative. This represents the preset distortion constant. This refers to the relaxation adjustment factor. This represents the first preset weighting coefficient. Represents the first presupposed positive real number. Represents the hyperbolic tangent function. This represents the function that takes the maximum value.
[0044] Along with the output of the singularity mask self-continuity extraction unit, the topology map tensor and the singularity mask jointly trigger the classification output unit to initiate the data flow process. The classification output unit calls the tensor concatenation algorithm to perform superposition and fusion calculations along the tensor channel dimension of the single-channel data structure's topology map tensor and the single-channel data structure's singularity mask. The tensor concatenation algorithm outputs a concatenated feature tensor of the dual-channel physical feature sequence.
[0045] The classification output unit inputs the concatenated feature tensor into a pre-defined defect classification network model. This model employs a convolutional neural network architecture with a shallow feedforward configuration. The concatenated feature tensor is passed sequentially through convolutional and pooling layers within the convolutional neural network architecture, performing matrix inner product operations within the local receptive domain to generate a feature dimensionality reduction matrix. This reduced matrix is then fed into a normalized exponential function layer. This layer extracts multidimensional Euler space values from the reduced matrix and performs exponential probability distribution conversion operations, outputting a defect confidence vector encompassing the probability of occurrence of various target physical defects.
[0046] A preset distortion constant is pre-entered into the system storage medium. This preset distortion constant characterizes the static topological geometric reference extreme value of the polymer material undergoing physical fracture under standard ambient temperature parameters. The relaxation adjustment factor characterizes the dynamic compensation coefficient of material stress, jointly determined by the current ambient temperature of the target manufacturing production line and the clamping force of the physical fixture. The continuity extraction unit extracts the preset distortion constant and the relaxation adjustment factor, performs a multiplication operation, and outputs the target deformation threshold. The physical reference boundary of the target deformation threshold is anchored to the microscopic tearing phase transition point of the butyl rubber material under industrial production stress conditions. The target deformation threshold divides the digital feature space of the curvature continuity derivative into an elastic non-affine deformation interval and a physical crack interval.
[0047] The activation function internally configures a first preset weight coefficient. This first preset weight coefficient is calibrated based on the steepness of the transition slope required by the hyperbolic tangent function near the target deformation threshold, ensuring that the microscopic tearing features are effectively amplified at the numerical output without being excessively attenuated by the smoothing function. When the instruction scheduling bus increases the input of the first preset weight coefficient, the slope of the numerical abrupt change curve, which marks the transition of the hyperbolic tangent function from a convergence suppression state to a convergence saturation state, increases sharply. This steep slope increase mechanism amplifies the physical scratch features at the critical state of microscopic tearing at the mathematical output to a singularity mask value approaching 1.
[0048] When a physical failure occurs in the hardware sensing environment or a sensor signal is lost, the product of the relaxation adjustment factor and the preset distortion constant tends to 0. When the continuity extraction unit performs the maximum value calculation operation of the denominator within the activation function, the maximum value function captures the product value tending to 0 and compares it with the first preset positive real number. The first preset positive real number is calibrated according to the lower limit of the system's floating-point arithmetic precision, ensuring that the first preset positive real number is much smaller than the normal operating range of the target deformation threshold, thus playing a zero-prevention protection role in abnormal 0 value scenarios. Based on the algebraic property that the first preset positive real number is greater than 0, the maximum value function locks the denominator calculation result and replaces it with the first preset positive real number. The injection mechanism of the first preset positive real number cuts off the arithmetic logic path of division by zero at the underlying machine code execution layer, eliminating the risk of system-level downtime caused by division-by-zero exceptions in the microprocessor's arithmetic logic unit.
[0049] When the physical region of the object under test corresponding to the target pixel coordinates is in an elastic stretching deformation state, the curvature continuity derivative calculated by the continuity extraction unit is less than or equal to the target deformation threshold. The continuity extraction unit performs a division calculation of the ratio parameter between the curvature continuity derivative and the target deformation threshold, and the difference between the ratio parameter and 1 falls into the negative real number interval. The first preset weight coefficient is multiplied by the difference in the negative real number interval, and the multiplication result is input to the input parameter of the hyperbolic tangent function, which remains negative. The hyperbolic tangent function performs asymptotic numerical mapping on the negative input parameter, and the numerical mapping result converges to the first set value. The singularity mask value that converges to the first set value shields the features caused by non-affine deformation at the physical decision layer. The system achieves algebraic dimension immunity to physical stretching deformation by means of the negative semi-axis characteristic of the hyperbolic tangent function.
[0050] When a tear or cut occurs in the physical region of the object to be measured corresponding to the target pixel coordinates, the abrupt change in the topological geometry of the local region causes the curvature continuity derivative calculated by the continuity extraction unit to expand and tend towards positive infinity. The ratio parameter calculation performed by the continuity extraction unit causes the input parameter of the hyperbolic tangent function to diverge synchronously and tend towards positive infinity. The hyperbolic tangent function, relying on the asymptote property of the positive semi-axis of the transcendental function, performs a numerical truncation mapping on the positive infinity input parameter. The numerical truncation mapping result of the hyperbolic tangent function transitions quickly and converges to a second set value, which is greater than the first set value. The upper bound of convergence to the second set value intercepts the propagation of divergent topological geometric difference features into the defect classification network model, preventing data overload failure caused by numerical overflow in the underlying activation function of the defect classification network model.
[0051] In the alternative scheme, the system's main control program configures the logistic function to replace the hyperbolic tangent function in generating singularity mask values. The continuity extraction unit extracts the ratio parameter between the curvature continuity derivative and the target deformation threshold, and sequentially performs linear translation correction and multiplication amplification operations with preset scaling coefficients on the ratio parameter. The continuity extraction unit inputs the ratio parameter, after linear translation correction and multiplication amplification operations, into the logistic function equation. The logistic function equation performs monotonically increasing exponential transformations based on the natural constant base. When the ratio parameter indicates that the curvature continuity derivative has not crossed the fracture phase transition point, the logistic function equation outputs a characteristic suppression state approaching the first set value; when the ratio parameter indicates that the curvature continuity derivative crosses the fracture phase transition point, the logistic function equation outputs a characteristic saturation state that transitions rapidly and converges to the second set value. The output curve of the logistic function equation replicates the asymptotic constraint boundary of the hyperbolic tangent function.
[0052] The continuity extraction unit calls a combined piecewise linear function with upper and lower bounds to replace the transcendental function system for mapping. The combined piecewise linear function is constructed by nesting a standard linear rectified function and a minimum function. The continuity extraction unit calculates the ratio parameter of the curvature continuity derivative to the target deformation threshold, and multiplies the difference between the ratio parameter and 1 by a preset slope tensor. The continuity extraction unit inputs the multiplication result into the standard linear rectified function to perform a zero-value underpinning operation. The standard linear rectified function filters out negative differences and overwrites the negative differences as the first set value. The continuity extraction unit inputs the non-negative values output by the standard linear rectified function into the minimum function. The minimum function truncates the input results that exceed the second set value and overwrites the second set value.
[0053] The continuity extraction unit pre-compiles the activation function into a read-only memory lookup table array containing discrete input intervals and mapping results. The construction of the read-only memory lookup table array is completed through offline static computation. The offline static computation process traverses the range of values for the ratio parameter of the curvature continuity derivative to the target deformation threshold, discretizing the range into discrete input intervals with fixed step sizes. The offline static computation process substitutes the center values of the discrete input intervals into the activation function formula to obtain the corresponding singularity mask calculation results. The read-only memory lookup table array uses the discrete input intervals as address keys and the singularity mask calculation results as storage values, and is permanently burned into the read-only memory in the form of a structure array. When the continuity extraction unit obtains the ratio parameter during detection, it retrieves the read-only memory lookup table array using memory-aligned addressing instructions to obtain the singularity mask calculation results corresponding to the discrete input interval where the ratio parameter is located.
[0054] The electronic device supporting the defect identification method includes a data bus, a central processing unit (CPU), a parallel computing unit array consisting of a graphics processing unit (GPU) or a neural network processor (NNZ), a cache, and video memory. Multi-polarization temporal image tensors are acquired by a multi-frame high-speed area array camera and transmitted to the video memory via a high-speed bus interconnecting external devices. Physically contiguous memory blocks are allocated within the video memory for latching the multi-polarization temporal image tensors. The CPU issues control commands to the parallel computing unit array via the system bus, and each computing core of the parallel computing unit array loads the data matrix of the multi-polarization temporal image tensor from the video memory. During the calculation of frequency domain alignment, polarization truncation, and curvature continuity derivatives, the accessed data matrix and intermediate variables are loaded into the L1 and L2 caches within the parallel computing unit array. After the parallel computing unit array completes the generation of the stitched feature tensor, it distributes the stitched feature tensor to the neural network processor array via a dedicated neural network acceleration bus. The multiply-accumulate array hardware units within the neural network processor array perform convolutional kernel matrix operations on the defect classification network model, and write the output defect confidence vector into the system's main memory space.
[0055] Virtual logic units such as the perception triggering unit, frequency domain alignment unit, polarization truncation unit, continuity extraction unit, and classification output unit are compiled into machine instruction sets by a high-level language compiler in the runtime environment. The high-level language compiler transforms the algorithm steps of each virtual logic unit into a binary machine code stream targeting a specific central processing unit core or neural network processor core. The machine code stream is stored in the program memory space of the electronic device. Under the scheduling of the operating system thread scheduler of the electronic device, the machine code stream is dynamically loaded into the instruction register of the execution thread. When the frequency domain alignment unit is executed, the execution thread dynamically allocates memory stack space for the aligned image sequence in the system stack area, pushes the pointer address of the aligned image sequence into the register, and calls the frequency domain bandstop mask calculation instruction set. When the continuity extraction unit is executed, the execution thread performs a difference accumulation approximation algorithm on the pixel coordinates of the edge contour in the vector register inside the processor, latches the curvature continuity derivative in the local variable area of the current stack frame, and writes the corresponding mask value into the singular point mask register according to the jump result of the Boolean decision instruction. Each virtual logic unit achieves data flow switching through thread context switching and stack pointer register movement within the processor.
[0056] Computer-readable storage media containing binary machine code streams and read-only memory lookup table arrays can take various physical forms. These include electrically erasable programmable read-only memory (EROM) for storing relaxation adjustment factors, preset distortion constants, and static physical constants and mapping tables such as the read-only memory lookup table array. Computer-readable storage media include flash memory, containing the underlying firmware that controls the operation of the sensing trigger unit, frequency domain alignment unit, polarization truncation unit, continuity extraction unit, and classification output unit. Computer-readable storage media include solid-state drives (SSDs) for storing multi-polarization temporal image tensors, network weight parameters of the defect classification network model, and records of defect confidence vectors from the identification output. Computer-readable storage media include optical media such as optical discs and magnetic media such as hard disks. Optical and magnetic media serve as physical entities for long-term storage of historical log data and process parameter calibration libraries from the defect image recognition system.
[0057] The above 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; and these 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. A method for image recognition of surface defects in rubber stoppers based on deep learning, characterized in that, Includes the following steps: Receive displacement pulse signals and acceleration sequences from the conveying device, and extract the motion phase; When the motion phase is within a preset phase range, a first trigger signal is generated; Based on the first trigger signal, acquire the multi-polarization state temporal image tensor of the object under test; The multi-polarization state time-series image tensor is transformed to the two-dimensional spatial frequency domain to obtain frequency domain feature components, and a band-stop mask is generated based on the acceleration sequence. The band-stop mask and the frequency domain feature components are masked, and the aligned image sequence is output after inverse Fourier transform. Based on the aligned image sequence, the polarization divergence index of each pixel coordinate is calculated; For any target pixel coordinate among the pixel coordinates, if the polarization divergence index of the target pixel coordinate is greater than a preset polarization threshold, the feature component corresponding to the target pixel coordinate in the aligned image sequence is set to zero. The aligned image sequence after the zeroing operation is fused along the temporal dimension to output a topological base map tensor; Extract the edge contours from the topological base map tensor, and calculate the curvature continuity derivative of the edge contours based on the arc length parameter; If the curvature continuity derivative is greater than the preset distortion constant, a singular point mask is generated at the pixel coordinate position corresponding to the edge contour. The topology tensor is concatenated with the singularity mask, input into a preset defect classification network model, and the defect confidence vector is output.
2. The deep learning-based image recognition method for rubber stopper surfaces according to claim 1, characterized in that, The generation of the band-stop mask based on the acceleration sequence includes: The acceleration sequence is subjected to a second time integration operation in combination with the exposure time window and parsed into a motion vector. The image shift pixel distance is generated based on the motion vector and the equivalent of the camera's pixel physical size. A point spread function model is constructed, and the frequency domain integration boundary is defined in the two-dimensional spatial frequency domain using the point spread function model. In the two-dimensional spatial frequency domain, the pole coordinates corresponding to the frequency domain integral boundary are extracted, and the band-stop mask covering the pole coordinates is generated.
3. The deep learning-based image recognition method for rubber stopper surfaces according to claim 1, characterized in that, The polarization divergence index is calculated as follows: Extract the luminance components of the same pixel coordinates in different time frames of the aligned image sequence; Calculate the variance between each of the brightness components, and use the variance as the polarization divergence index of the corresponding pixel coordinates.
4. The deep learning-based image recognition method for rubber stopper surfaces according to claim 1 or 3, characterized in that, The preset polarization threshold is calculated based on the refractive index of the surface coating and the refractive index of the substrate material of the object under test, using the Brewster angle equation.
5. The deep learning-based image recognition method for rubber stopper surfaces according to claim 1, characterized in that, The step of generating a singularity mask at the pixel coordinates corresponding to the edge contour includes: Obtain the relaxation adjustment factor, multiply the relaxation adjustment factor by the preset distortion constant, and determine the target deformation threshold; The target deformation threshold is subjected to a maximum value operation with the first preset positive real number. The result of the maximum value operation is used as the denominator, and the curvature continuity derivative is used as the numerator to calculate the ratio parameter. The difference between the ratio parameter and the constant 1 is scaled and calculated using a first preset weighting coefficient to generate the input parameter; The input parameter is numerically mapped to a monotonically increasing nonlinear activation function, and the mapping result is used as the value of the singularity mask. The nonlinear activation function satisfies the following constraints: when the input parameter indicates that the curvature continuity derivative is less than or equal to the target deformation threshold, the mapping result converges to a first set value; when the input parameter indicates that the curvature continuity derivative is greater than the target deformation threshold, the mapping result rapidly transitions and converges to a second set value, and the second set value is greater than the first set value.
6. The deep learning-based image recognition method for rubber stopper surfaces according to claim 5, characterized in that, The nonlinear activation function calculates the value of the singularity mask using the following formula: in, This indicates the value of the singularity mask. The derivative of the curvature continuity is represented by the derivative. This represents the preset distortion constant. This refers to the relaxation adjustment factor. This represents the first preset weighting coefficient. Represents the first presupposed positive real number. Represents the hyperbolic tangent function. This represents the function that takes the maximum value.
7. A deep learning-based image recognition system for rubber stopper surface defects, characterized in that, include: Sensing trigger unit: used to receive displacement pulse signals and acceleration sequences from the conveying device and extract the motion phase; When the motion phase is within a preset phase range, a first trigger signal is generated; Based on the first trigger signal, acquire the multi-polarization state temporal image tensor of the object under test; Frequency domain alignment unit: used to transform the multi-polarization state time-series image tensor to the two-dimensional spatial frequency domain, obtain frequency domain feature components, and generate a band-stop mask based on the acceleration sequence; The band-stop mask and the frequency domain feature components are masked, and the aligned image sequence is output after inverse Fourier transform. Polarization truncation unit: used to calculate the polarization divergence index of each pixel coordinate based on the aligned image sequence; for any target pixel coordinate in the pixel coordinates, if the polarization divergence index of the target pixel coordinate is greater than a preset polarization threshold, the feature component corresponding to the target pixel coordinate in the aligned image sequence is zeroed; the aligned image sequence after the zeroing operation is fused along the temporal dimension to output a topological base map tensor; Continuity extraction unit: used to extract edge contours in the topological base map tensor and calculate the curvature continuity derivative of the edge contours based on the arc length parameter; If the curvature continuity derivative is greater than the preset distortion constant, a singular point mask is generated at the pixel coordinate position corresponding to the edge contour. Classification output unit: used to concatenate the topology map tensor with the singular point mask, input a preset defect classification network model, and output a defect confidence vector.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the deep learning-based image recognition method for rubber stopper surface defects as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the deep learning-based image recognition method for rubber stopper surface defects as described in any one of claims 1 to 6.
