A material quality testing system, method, medium, and equipment
By employing an adjustable frame and multi-mode detection technology in the material quality inspection system, combined with spectral and visual inspection, and utilizing an improved ResNet model for internal defect identification of materials, rapid and automated grading of material quality is achieved, solving the problems of insufficient detection accuracy and efficiency in existing technologies.
Patent Information
- Application Number
- CN202510386559.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-03-28
AI Technical Summary
Existing material intrinsic quality testing technologies have limitations in terms of accuracy, efficiency, and applicability, especially in batch testing or production line environments where testing efficiency is low and accuracy is insufficient.
Multiple fiber optic probes and light sources are mounted on an adjustable rack to achieve multi-mode detection. Combining spectral detection and visual inspection, an improved ResNet model is used to identify internal defects in materials, and automated sorting is achieved through a sorting module.
It enables rapid and automated grading of material quality, improves detection accuracy and efficiency, is suitable for large-scale production environments, and is highly efficient and applicable to multiple materials.
Smart Images

Figure CN120571773B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quality testing and screening technology for agricultural products, specifically to a material quality testing system, method, medium, and equipment. Background Technology
[0002] In the post-harvest commercial processing of agricultural products, internal and external quality grading has always played a crucial role. Traditionally, the detection of the internal quality of materials has mainly relied on destructive testing methods such as chemical analysis. These methods are not only time-consuming and cumbersome, but also highly susceptible to human factors, leading to issues with the consistency and accuracy of the results.
[0003] To address these issues, near-infrared spectroscopy (NIRS) technology has been introduced in recent years for the detection of intrinsic material quality. During the acquisition of material absorption spectra using transmission methods, the magnitude of the detection signal and the accuracy of the detection are significantly affected by various factors. In contrast, while diffuse reflection provides an alternative, it typically uses a fixed light source and receiver setup, allowing detection at only one location on the material, resulting in lower accuracy. Existing technologies also employ pre-set integration times and a pre-set number of tests to perform multiple in-situ localized tests and average the results to obtain the quality detection results of the material under test. Although this in-situ localized detection method can improve accuracy to some extent, it inherently only acquires quality information from the shallow surface layer of the material, limiting its ability to accurately reflect changes in the internal quality of the material. More importantly, when applied to batch testing or production line environments, this in-situ detection method may lead to a decrease in overall detection efficiency because additional time is required for multiple tests to ensure the reliability of the results.
[0004] In summary, existing material intrinsic quality testing technologies still have limitations in terms of accuracy, efficiency, and applicability. Therefore, there is an urgent need for a new solution that can improve testing accuracy while ensuring high efficiency and being suitable for rapid testing needs in large-scale production environments. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a material quality inspection system. By setting up a spectral detection module with an adjustable frame, it can receive light signals from materials from multiple angles, enabling multi-mode detection such as diffuse reflection, slow transmission, and transmission.
[0006] To achieve the above objectives, the present invention provides a material quality inspection system, including a feeding module, a conveying module, a spectral detection module, a visual inspection module, a sorting module, and an information management module. The information management module is connected to the feeding module, the conveying module, the spectral detection module, the visual inspection module, and the sorting module. The conveying module is connected to the discharge end of the feeding module.
[0007] The spectral detection module is located downstream of the conveying module and includes a dark box, a visible and near-infrared spectrometer, multiple fiber optic probes, multiple first light sources, multiple second light sources, a laser ranging sensor, and an adjustable frame. A portion of the downstream side of the conveying module passes through the dark box. The adjustable frame is located on the inner wall of the dark box and above the conveying module. The multiple fiber optic probes, the multiple first light sources, and the laser ranging sensor are mounted on the adjustable frame. The information management module controls the movement of the adjustable frame, thereby driving the movement of the multiple fiber optic probes, the multiple first light sources, and the laser ranging sensor. The multiple second light sources are located inside the dark box and below the conveying module. The conveying module has acquisition holes located inside the dark box. The multiple fiber optic probes, the multiple first light sources, the multiple second light sources, and the laser ranging sensor are positioned corresponding to the acquisition holes. The multiple fiber optic probes are connected to the visible and near-infrared spectrometer. The sorting module is connected to the discharge end of the conveying module. The visual inspection module is located at the feed end of the sorting module.
[0008] The adjustable frame includes a first support plate, a first adjustment component, a connecting rod, and two second adjustment components. The first support plate is disposed on the inner wall of the darkroom. The first adjustment component includes a first slider, a first slide rail, and an electric push rod. The first slide rail is vertically disposed on the first support plate and located directly above the acquisition hole. The first slider moves vertically along the first slide rail under the drive of the electric push rod. At least one of the plurality of fiber optic probes and the laser ranging sensor are mounted on the first slider. The connecting rod passes horizontally through the first slider, with the first slider located in the middle of the connecting rod. The two second adjustment components are symmetrically disposed at both ends of the connecting rod. Each second adjustment component includes a transmission rod, a second slide rail, and a second slider. The transmission rod is connected to one end of the connecting rod. The second slide rail is disposed on the first support plate. The second slider slides along the second slide rail under the drive of the transmission rod. The second slide rail forms an angle with the first slide rail. The remaining plurality of fiber optic probes are mounted on the second slider.
[0009] The second slider includes an arc-shaped wall and a sliding part. The sliding part is connected to the middle of the arc-shaped wall. The sliding part slides along the second slide rail under the drive of the transmission rod. The remaining plurality of fiber optic probes are disposed on the arc-shaped wall and symmetrically located on both sides of the sliding part. At least one of the first light sources is disposed in the middle of each arc-shaped wall.
[0010] The feeding module includes a first conveying mechanism and a sorting mechanism, wherein: the first conveying mechanism is inclined and a baffle hopper is provided at the feeding end; the sorting mechanism is provided at the discharge end of the first conveying mechanism and includes a first V-shaped groove, two first conveyor belts and a first brush roller, the two first conveyor belts are arranged in a V-shape correspondingly in the first V-shaped groove, the first brush roller is located above the first conveyor belt and gently contacts the material on the first conveyor belt, and the axis of the first brush roller is parallel to the traveling direction of the first conveyor belt.
[0011] The conveying module includes a second V-shaped groove, two second conveyor belts, and a second brush roller, wherein: the two second conveyor belts are arranged in a V-shape corresponding to each other in the second V-shaped groove, and the two second conveyor belts are connected to the two first conveyor belts; the second brush roller is located upstream of the second conveyor belt and gently contacts the material on the second conveyor belt, and the axis of the second brush roller is perpendicular to the traveling direction of the second conveyor belt; the spectral detection module is located downstream of the second conveyor belt.
[0012] The sorting module includes a first sorting unit and multiple second sorting units, wherein: the first sorting unit is connected to the discharge end of the conveying module, the vision detection module is disposed at the feed end of the first sorting unit, the first sorting unit includes a second conveying mechanism and multiple sorting action mechanisms; the second conveying mechanism is connected to the two second conveyor belts, and multiple movable material trays are disposed on the second conveying mechanism, and each sorting action mechanism corresponds to at least one material tray; the multiple sorting action mechanisms correspond to the multiple second sorting units respectively; each sorting action mechanism causes the material in the corresponding material tray to fall into the corresponding second sorting unit according to the instructions of the information management module.
[0013] The material tray includes a roller bracket and rollers, with the rollers rotatably mounted in the roller bracket; the second conveying mechanism includes a conveying chain with multiple connecting plates spaced apart on the conveying chain; the roller bracket is mounted on the connecting plates and is driven to tilt by the corresponding sorting action mechanism.
[0014] The connecting plate has a support slot, and a support block is provided in the support slot; the roller bracket is connected to a U-shaped support rod, and the middle part of the U-shaped support rod is supported in the support slot by the top of the support block; the material tray tilts to the side with the support slot as the fulcrum.
[0015] The sorting mechanism includes a swing arm, a cylinder, and a rotating shaft, wherein: one end of the swing arm is connected to the cylinder and is hinged to the frame of the first sorting unit via the rotating shaft; the swing arm is driven by the cylinder to rotate upward around the rotating shaft; when the swing arm rotates upward, the other end of the swing arm pushes against one side of the corresponding material tray, causing the material tray to tip over.
[0016] The information management module includes a data processing unit and a control unit interconnected with each other. The data processing unit is connected to the spectral detection module and the visual inspection module. The data processing unit is used to identify internal and external defects of the material, label the defect types, and calculate the composition content of the material. The control unit is connected to and controls the feeding module, the conveying module, the spectral detection module, the visual inspection module, and the sorting module. The control unit is used to control the sorting module according to the defect types and composition content to complete the sorting of the material.
[0017] The data processing unit uses an improved ResNet model to identify internal defects in materials. The improved ResNet model includes: replacing ordinary convolutions in the residual structure with more than 128 channels in the ResNet model with adaptive depthwise separable convolutions, wherein the weights of the depthwise convolutions and pointwise convolutions in the adaptive depthwise separable convolutions are generated in real time based on the input data; and adding an adaptive attention mechanism to the third and fourth residual blocks of the ResNet model, wherein the adaptive attention mechanism includes dynamically generating convolution kernels and attention weights.
[0018] On the other hand, the present invention also provides a material quality inspection method, which adopts the above-mentioned material quality inspection system and includes the following steps: the material enters the inspection area through the feeding module and the conveying module; spectral detection is performed using the spectral detection module; an improved ResNet model is used to identify internal defects in the material; if internal defects exist, the defect type is marked; if no internal defects exist, the component content of the material is calculated using the AlexNet model; visual inspection is performed using the visual inspection module; external defects in the material are identified based on a deep learning model; when external defects exist, the defect type is marked; and the sorting module completes the sorting of the material according to the defect type and the component content.
[0019] The improved ResNet model is constructed using the following steps: obtaining the sample diameter D using the laser rangefinder; acquiring one-dimensional transmission spectrum data of the sample using a visible-near-infrared spectrometer; and optimizing the one-dimensional transmission spectrum data using the diameter D, with the optimization formula being:
[0020] I adjusted =I0×e μD ×(1+αΔT),
[0021] Among them, I adjusted The optimized spectral intensity is I0, where I0 is the spectral intensity of the incident light in the one-dimensional transmission spectral data, and αΔT is the correction factor used for temperature compensation; α is the temperature compensation coefficient, and ΔT is the temperature change.
[0022] The optimized spectral intensity data is preprocessed to generate a first dataset; reflectance image data of the sample is collected, texture features are extracted, and the reflectance image dataset with the texture features is defined as a second dataset; the first dataset and the second dataset are dynamically weighted and fused to generate a third dataset; the third dataset is augmented and labeled, and divided into a training set, a validation set, and a test set, wherein the labeling includes the labeled diameter, variety, component content, and defect type; the improved ResNet model is trained using the labeled training set, and validated and tested using the validation set and the test set; the improved ResNet model is optimized using a hybrid loss function.
[0023] On the other hand, the present invention also provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the above-described material quality detection method.
[0024] On the other hand, the present invention also provides a computer-readable storage medium for storing a computer program; when the computer program is executed by a processor, it implements the material quality detection method as described above.
[0025] As can be seen from the above solutions, the advantages of the present invention are:
[0026] This invention's material quality inspection system integrates conveying, inspection, and sorting functions, achieving rapid and automated material grading. It combines spectral detection and multi-mode detection technologies to identify internal defects and analyze component content in materials. Employing an adjustable fiber optic probe and a primary light source, the system allows for combined detection of multiple modes, including diffuse reflection, diffuse transmission, and transmission, by flexibly adjusting the distance and angle between the primary light source and the fiber optic probe. It also supports simultaneous measurement across multiple modes, angles, and positions. Each conveying mechanism ensures stable material transport, effectively preventing mechanical damage and collisions. This material quality inspection system is highly efficient, automated, and applicable to multiple materials, providing a precise and intelligent solution for online material quality inspection and grading, and possesses significant potential for widespread application.
[0027] The material quality inspection method of this invention is based on a ResNet model that is adaptively improved by depth-separable convolution of one-dimensional spectral data and efficient channel attention mechanism to identify internal defects in materials. It dynamically generates convolution kernels and attention weights, and flexibly adjusts the structure of the attention mechanism to comprehensively improve the model's adaptability to sample characteristics. While improving detection accuracy, it keeps the model size small, making it suitable for resource-constrained hardware environments and meeting the needs of industrial production lines for real-time online inspection. Attached Figure Description
[0028] Figure 1 This is a schematic diagram of the overall structure of the material quality detection system of the present invention (I);
[0029] Figure 2 This is a schematic diagram (II) of the overall structure of the material quality detection system of the present invention;
[0030] Figure 3 yes Figure 1 A three-dimensional diagram of a sorting mechanism;
[0031] Figure 4 It is a 3D diagram showing the cooperation between the transmission module and the spectral detection module;
[0032] Figure 5 This is a front view of the adjustable rack located in the dark box;
[0033] Figure 6 yes Figure 5 A partial enlarged view of the adjustable frame;
[0034] Figure 7 This is a 3D view of the sorting module;
[0035] Figure 8 yes Figure 7 Enlarged view of region A in the middle;
[0036] Figure 9 yes Figure 7 A schematic diagram of the structure of a single material tray;
[0037] Figure 10 yes Figure 7 A schematic diagram showing the interaction between a single material tray and a link in the conveyor chain;
[0038] Figure 11 This is a flowchart of the material quality testing method of the present invention;
[0039] Figure 12 This is a flowchart of the construction process of the improved ResNet model of this invention;
[0040] Figure 13 This is a schematic diagram of the residual structure of the ResNet model in the existing technology;
[0041] Figure 14 These are schematic diagrams of conventional convolution (left) and depthwise separable convolution (right) in existing technologies;
[0042] Figure 15 This is a schematic diagram of the adaptive attention mechanism provided by the present invention;
[0043] Figure 16 This is a schematic diagram of the structure of the improved ResNet18 model provided by the present invention;
[0044] Figure 17 This is a schematic diagram of the structure of the electronic device provided by the present invention;
[0045] In the attached figures, the following labels are used:
[0046] 1. Feeding module; 10. First conveying mechanism; 11. Bucket; 12. Sorting mechanism; 121. First brush roller; 121a. First mounting frame; 122. First conveyor belt; 123. Bevel gear; 124. First V-groove; 2. Conveying module; 21. Second conveyor belt; 22. Second V-groove; 23. Second brush roller; 23a. Second mounting frame; 3. Spectral detection unit; 30. Dark box; 31. First support plate; 32. First slide rail; 33. Electric push rod; 34. First slider; 35. Laser rangefinder sensor; 36. First fiber optic probe; 37. Connecting rod; 371. Long hole; 380. Second slide rail; 381. Transmission rod; 381a. Transmission pin; 382. Second slider; 383. Arc arm; 390. Adjustable connecting plate; 391. Second fiber optic probe 392. Third fiber optic probe; 393. First light source; 394. Fourth fiber optic probe; 395. Fifth fiber optic probe; 4. Vision inspection module; 5. First sorting unit; 50. Second conveying mechanism; 51. Material tray; 511. Roller; 512. Roller bracket; 5121. Convex plate; 513. U-shaped support rod; 514. Tilting shaft; 52. Sorting action mechanism; 521. Cylinder; 522. Swing arm; 523. Rotating shaft; 53. Conveyor chain; 531. Chain link; 54. Connecting plate; 541. Support slot; 542. Support block; 6. Second sorting unit; 7. Sorting module; 8. Information management module; 300. Electronic equipment; 301. Processor; 302. Memory; 303. Computer program; S10~S40 and S100~S107, Steps. Detailed Implementation
[0047] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments to further understand the purpose, solution and effect of the present invention, but it is not intended to limit the scope of protection of the appended claims.
[0048] References to "embodiment," "another embodiment," "this embodiment," etc., in the specification refer to embodiments that may include specific features, structures, or characteristics, but not every embodiment must include these specific features, structures, or characteristics. Furthermore, such expressions do not refer to the same embodiment. Moreover, when describing specific features, structures, or characteristics in conjunction with embodiments, whether or not explicitly described, it is indicated that incorporating such features, structures, or characteristics into other embodiments is within the knowledge of those skilled in the art.
[0049] The specification and subsequent claims use certain terms to refer to specific components or parts. Those skilled in the art will understand that users or manufacturers may use different names or terms to refer to the same component or part. This specification and claims do not distinguish components or parts by differences in name, but rather by differences in function. The terms "comprising" and "including" used throughout the specification and claims are open-ended and should be interpreted as "including but not limited to". Furthermore, the term "connection" here includes any direct and indirect electrical connection means. Indirect electrical connection means include connections via other means.
[0050] It should be noted that in the description of this invention, the terms "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, a specific size, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0051] One embodiment of the present invention provides a material quality testing system that solves the problem that existing in-situ testing methods cannot accurately reflect internal quality changes in fruits, and may lead to a decrease in testing efficiency in batch testing or on production lines.
[0052] To solve the technical problem, the overall idea of the technical solution of the present invention is as follows: An adjustable frame is set in the spectral detection module, and multiple fiber optic probes and a first light source are installed on the adjustable frame. By adjusting the adjustable frame, the positions of the multiple fiber optic probes and the first light source are changed, thereby receiving the light signal of the material from multiple angles and realizing multi-mode detection such as diffuse reflection, slow transmission and transmission.
[0053] Figure 1 and Figure 2 This is a schematic diagram of the structure of a material quality inspection system provided in an embodiment of the present invention. The material quality inspection system includes: a feeding module 1, a conveying module 2, a spectral detection module 3, a visual inspection module 4, a sorting module 7, and an information management module 8.
[0054] The feeding module 1 includes a first conveying mechanism 10. The first conveying mechanism 1 adopts a roller conveying mechanism and is inclined (the feeding end is lower than the discharging end). The bottom feeding end is provided with a baffle hopper 11. After the material is placed, it can be arranged in sequence on the first conveying mechanism 10 and moved.
[0055] like Figure 3As shown, the feeding module 1 also includes a sorting mechanism 12 disposed at the discharge end of the first conveying mechanism 10. The sorting mechanism 12 includes a first V-shaped groove 124, two first conveyor belts 122, and a first brush roller 121. The two first conveyor belts 122 are arranged in a V-shape within the first V-shaped groove 124, thus forming a V-shaped conveying channel between the two first conveyor belts 122. The two ends of the two first conveyor belts 122 are respectively wound around corresponding rollers. One of them on one side is a driving roller and the other is a driven roller. The driving roller and the driven roller on the same side have a certain included angle. The lower ends of the driving roller and the driven roller are driven by a pair of bevel gears 123. The driving roller and the driven roller are both installed at the ends of the first V-shaped groove 124. The first V-shaped groove 124 is made of steel plate. The two groove walls of the first V-shaped groove 124 support the sections of the two first conveyor belts 122 located in the first V-shaped groove 124. The first conveyor belts 122 provide the power for the material to move forward, and the V-shaped conveying channel restricts the material to move along its length.
[0056] The first brush roller 121 is positioned above the two first conveyor belts 122 and is detachably mounted on the first V-groove 124 via the first mounting bracket 121a. The first brush roller 121 is, for example, a nylon brush roller, and its length is aligned with the length of the first V-groove 124, meaning the axis of the first brush roller 121 is parallel to the travel direction of the first conveyor belts 122. The first brush roller 121 is located at the discharge end of the first conveying mechanism 10 and can make gentle contact with the material passing beneath it to control the material's progress and achieve a queuing effect. Thus, the sorting mechanism 12 not only achieves single-column sorting of materials but also further removes soil from the materials, such as potatoes, sweet potatoes, jicama, apples, pears, and eggplants.
[0057] like Figure 4 As shown, the conveying module 2 includes a second V-shaped groove 22, two second conveyor belts 21, and a second brush roller 23. The two second conveyor belts 21 are arranged in a V-shape within the second V-shaped groove 22, forming another V-shaped conveying channel between them. The two second conveyor belts 21 connect to the two first conveyor belts 122, meaning materials can be conveyed from the two first conveyor belts 122 to the two second conveyor belts 21. The principle of the second conveyor belts 21 is the same as that of the first conveyor belts 122, and will not be described again here. The V-shaped conveyor belts, through the clamping effect of the V-shaped structure, prevent excessive rolling of materials, control the material's movement trajectory, and reduce material slippage or tipping during conveying. The second brush roller 23 is detachably mounted on the second V-shaped groove 22 via a second mounting bracket 23a. The second brush roller 23 is located upstream of the second conveyor belts 21 and gently contacts the material on the second conveyor belts 21. The axis of the second brush roller 23 is perpendicular to the traveling direction of the second conveyor belts 21.
[0058] The spectral detection module 3 is located downstream of the second conveyor belt 21. The spectral detection module 3 includes a dark box 30, a visible-near-infrared spectrometer (not shown), multiple fiber optic probes, multiple first light sources 393, multiple second light sources, a laser rangefinder 35, and an adjustable frame. A portion of the downstream section of the conveyor module 2 passes through the dark box 30, which can be understood as a light shield, and the second V-groove 22 passes through the dark box 30. The multiple fiber optic probes are connected to the visible-near-infrared spectrometer. The multiple fiber optic probes, multiple first light sources 393, and the laser rangefinder 35 are mounted on the adjustable frame, which is located on the inner wall of the dark box 30 and above the two downstream sections of the second conveyor belts 21.
[0059] The information management module 8 controls the movement of the adjustable frame, thereby driving the movement of multiple fiber optic probes, multiple first light sources 393, and a laser rangefinder 35. Multiple second light sources are located inside a dark box 30, below the conveying module 2. The conveying module 2 has a collection hole (not shown) inside the dark box 30. There is a certain distance between the bottoms of the two second conveyor belts 21, allowing the collection hole to be exposed. The multiple fiber optic probes, multiple first light sources 393, multiple second light sources, and the laser rangefinder 35 are positioned corresponding to the collection hole. The multiple fiber optic probes and multiple first light sources 393 are distributed on the adjustable frame, and in conjunction with the multiple second light sources, can receive light signals from materials at multiple angles, achieving multi-mode detection of diffuse reflection, diffuse transmission, and transmission.
[0060] Specifically, such as Figure 5 As shown and Figure 6 As shown, the adjustable frame includes a first support plate 31, a first adjustment assembly, a connecting rod 37, and two second adjustment assemblies. Wherein:
[0061] The first support plate 31 is disposed on the inner wall of the dark box 30; the first adjustment component includes a first slider 34, a first slide rail 32 and an electric push rod 33. The first slide rail 32 is vertically disposed on the first support plate 31 and located directly above the acquisition hole. The first slider 34 moves vertically along the first slide rail 32 under the drive of the electric push rod 33.
[0062] At least one of the multiple fiber optic probes and the laser ranging sensor 35 are mounted on the first slider 34. In this invention, there are five fiber optic probes: a first fiber optic probe 36, a second fiber optic probe 391, a third fiber optic probe 392, a fourth fiber optic probe 394, and a fifth fiber optic probe 395. There are two first light sources 393, but this is not a limitation. The first fiber optic probe 36 is mounted on the first slider 34 and located directly above the acquisition hole. The second fiber optic probe 391, the third fiber optic probe 392, and one of the first light sources 393 constitute a first spectral unit. The fourth fiber optic probe 394, the fifth fiber optic probe 395, and the other first light source 393 constitute a second spectral unit. The first and second spectral units are symmetrically arranged on both sides of the first fiber optic probe 36. If the conveying direction of the second conveyor belt 21 is defined as the front-to-back direction, then the two sides of the first fiber optic probe 36 are the two sides in the left-to-right direction, i.e., the connecting rod 37 is perpendicular to the second conveyor belt 21.
[0063] The connecting rod 37 passes horizontally through the first slider 34, with the first slider 34 located in the middle of the connecting rod 37. Two second adjusting components are symmetrically arranged at both ends of the connecting rod 37. Each second adjusting component includes a transmission rod 381, a second slide rail 380, and a second slider 382. The first spectral unit and the second spectral unit have the same structure, so only the first spectral unit is described. The first spectral unit is mounted on the second slider 382. The second slider 382 is provided with a transmission rod 381, the length direction of which is consistent with the length direction of the second slide rail 380. The transmission rod 381 is connected to one end of the connecting rod 37. Each end of the connecting rod 37 is provided with an elongated hole 371, and one end of each transmission rod 381 is vertically provided with a transmission pin 381a, which is installed in the corresponding elongated hole 371. The second slide rail 380 is disposed on the first support plate 31, and the second slider 382 is slidably mounted on the second slide rail 380. The second slider 382 slides along the second slide rail 380 under the drive of the transmission rod 381. The second slide rail 380 has a certain angle with the first slide rail 32, and the remaining plurality of fiber optic probes are mounted on the second slider 382.
[0064] The second slider 382 includes an arc-shaped wall 383 and a sliding part (not shown in the figure), which slides in engagement with the second slider 382. The middle part of the arc-shaped wall 383 is connected to the sliding part, which slides along the second slide rail 380 under the drive of the transmission rod 381. Taking the first spectral unit as an example, as... Figure 6As shown, the second fiber optic probe 391 and the third fiber optic probe 392 are located on both sides of the sliding part, and a first light source 393 is disposed between the second fiber optic probe 391 and the third fiber optic probe 392. The second fiber optic probe 391 and the third fiber optic probe 392 are also mounted on the second slider 382 through an L-shaped adjustable connecting plate 390. The adjustable connecting plate 390 has an elongated hole as a connection hole. When fixed with bolts, the initial angle of the adjustable connecting plate 390 can be adjusted, thereby adjusting the initial angle of the second fiber optic probe 391 and the third fiber optic probe 392.
[0065] The first light source 393 and the second light source are both halogen lamps. The second light source is located below the acquisition hole and shines upwards. For example, three second light sources can be set, one of which is directly below the acquisition hole, and the other two are symmetrically arranged about the vertical direction, with the emitted light beams at an angle. The second light source is fixed to the bottom of the dark box 30 by a corresponding second support plate (not shown in the figure). The second support plate is connected to the first support part 31, and the two may have the same or different structures.
[0066] The position of the first fiber optic probe 36 can be adjusted using the electric push rod 33, changing the distance between the first fiber optic probe 36 and the material. The upward movement of the electric push rod 33 drives the first slider 34 upward, thus raising the first fiber optic probe 36. Simultaneously, the connecting rods 37 on both sides of the first slider 34 drive the first and second spectral units. The connecting rods 37 drive the transmission rod 381 to move obliquely upward, and the transmission rod 381 drives the second slider 382 to move along the second slide rail 380. This achieves synchronous adjustment of the second fiber optic probe 391, the third fiber optic probe 392, the fourth fiber optic probe 394, the fifth fiber optic probe 395, and the first light source 393. The adjustment distance can be set according to different types of materials. Parameters can be preset in the data processing unit of the information management module 8. When the user selects a material type via the touch screen on the device, the material quality detection system automatically adjusts each fiber optic probe and the first light source 393 to the preset position.
[0067] The first fiber optic probe 36 faces the material and can receive transmitted and diffuse transmission signals; the remaining fiber optic probes (including the second fiber optic probe 391, the third fiber optic probe 392, the fourth fiber optic probe 394, and the fifth fiber optic probe 395) are located on one side and can receive diffuse reflection signals. Different fiber optic probes can be used simultaneously, at different times, or selected for use.
[0068] A laser rangefinder 35 is also provided on the first slider 34 for emitting laser light onto the material surface. The laser rangefinder 35 is located near the first fiber optic probe 36 and emits laser light directly downwards. Since the bottom of the material is fixed, the diameter of the material can be determined by measuring the distance from the detection point of the laser rangefinder 35 to the material surface. Because the material is not a perfect sphere, the measured diameter is not very precise; it only provides a relative material size parameter for calibration. Several sets of data from the laser rangefinder 35 can be compared. When the distance from the detection point of the laser rangefinder 35 to the material surface is smallest, the material diameter is largest, and the calculated diameter at this point can be considered the material diameter D.
[0069] The vision inspection module 4 includes an industrial camera for acquiring images of the material surface. The vision inspection module 4 is located at the feeding end of the sorting module 7. The vision inspection module 4 is designed to acquire the material's appearance data, which is then sent to the data processing unit for analysis of the material's dimensions and surface quality (including surface texture and other information). Vision inspection technology is a mature technology and will not be described in detail here.
[0070] like Figure 7 As shown, the sorting module 7 includes a first sorting unit 5 and multiple second sorting units 6. The first sorting unit 5 is connected to the discharge end of the conveying module 2, and the vision inspection module 4 is located at the feed end of the first sorting unit 5. The first sorting unit 5 includes a second conveying mechanism 50 and multiple sorting action mechanisms 52. The second conveying mechanism 50 is connected to two second conveyor belts 21. Multiple second sorting units 6 and sorting action mechanisms 52 are provided, and they are arranged in a one-to-one correspondence. Each second sorting unit 6 is connected to the second conveying mechanism 50. The second sorting unit 6 can also be a conveyor belt to transport materials of corresponding specifications after sorting. One second sorting unit 6 can correspond to one specification of material (which can be understood as the quality grade comprehensively evaluated by the information management module 8 in the material quality inspection system of this invention; the quality grade is determined based on the detected material defect type, component content, etc.). The conveying direction of the second sorting unit 6 and the second conveying mechanism 50 is perpendicular, that is, the material on the second conveying mechanism 50 is diverted to each second sorting unit 6 on both sides.
[0071] like Figures 8 to 10 As shown, the second conveying mechanism 50 is equipped with multiple movable material trays 51, and each sorting action mechanism 52 corresponds to at least one material tray 51. Each sorting action mechanism 52 drives the corresponding material tray 51 according to the instructions of the control unit of the information management module 8, so that the material in the material tray 51 falls into the corresponding second sorting unit 6. The material tray 51 includes a roller 511 and a roller support 512. The roller support 512 is generally U-shaped, and the roller 511 is rotatably mounted in the roller support 512.
[0072] The second conveying mechanism 50 uses a conveying chain 53, on which multiple connecting plates 54 are spaced apart. Roller supports 512 are mounted on corresponding connecting plates 54 and are driven to tilt by corresponding sorting mechanisms 52. The bottom of the connecting plate 54 is riveted to a link 531 of the conveying chain 53. The connecting plate 54 has a support slot 541. The roller support 512 of the material tray 51 is connected to a U-shaped support rod 513, which passes through the support slot 541 and is supported at its center. The support at the support slot 541 can be understood as a point support; when the material tray 51 is subjected to a lateral tilting force, it can tilt to the other side using the support slot 541 as a fulcrum. Under normal conditions, the bottom of the roller support 512 has a downwardly protruding plate 5121, supported by a position on the connecting plate 54. The aforementioned point support is provided by the top of the triangular support block 542. The inclined surfaces on both sides of the support block 542 can also serve as limiting surfaces to restrict the excessive rotation of the U-shaped support rod 513, so that the material holder 51 can rotate within a certain angle range to allow the material to be released.
[0073] like Figure 8 As shown, the sorting mechanism 52 includes a swing arm 522, a cylinder 521, and a rotating shaft 523. One end of the swing arm 522 is hinged to the end of the telescopic rod of the cylinder 521. One end of the swing arm 522 is a bend, and a rotating part is provided near the hinge position. The rotating part of the swing arm 522 is hinged to the frame of the first sorting unit 5 by the rotating shaft 523. The swing arm 522 is driven by the cylinder 521 to rotate upward around the rotating shaft 523 at a certain angle. When the cylinder 521 retracts, the swing arm 522 returns to its original position. When the swing arm 522 rotates upward, the other end of the swing arm 522 can push against one side of the corresponding material tray 51 and cause the material tray 51 to tilt, thereby causing a piece of material on the material tray 51 to fall into the corresponding second sorting unit 6. When the material tray 51 tilts, it tilts around a flipping shaft 514 at one end, and the other end of the flipping shaft 514 is rotatably mounted on the connecting plate 54. As for which sorting mechanism 52 will operate, the command is issued by the control unit and is determined by the material quality analysis of the material quality detection system, so that materials of the preset quality level can accurately enter the corresponding second sorting unit 6.
[0074] The information management module 8 includes an interconnected data processing unit and a control unit. The data processing unit is connected to the spectral detection module 3 and the visual inspection module 4. The data processing unit is used to identify internal and external defects of materials, mark the types of defects, calculate the composition content of materials, and analyze the quality of materials. The control unit is connected to and controls the feeding module 1, the conveying module 2, the spectral detection module 3, the visual inspection module 4, and the sorting module 7. The control unit is used to control the sorting module 7 according to the types of defects and the composition content to complete the sorting of materials.
[0075] The data processing unit processes the data collected by each fiber optic probe and is connected to the visible and near-infrared spectrometer. The control unit controls the movement of the electric actuator 33, the switching on and off of each light source, and the start / stop and speed of the motors in each module.
[0076] The data processing unit employs an improved ResNet model when identifying internal defects in materials. This improved ResNet model includes: replacing ordinary convolutions in the residual structure with more than 128 channels in the ResNet model with adaptive depthwise separable convolutions, where the weights of the depthwise convolutions and pointwise convolutions are generated in real-time based on the input data; and adding an adaptive attention mechanism to the third and fourth residual blocks of the ResNet model, where the adaptive attention mechanism includes dynamically generating convolution kernels and attention weights. See the steps in the method embodiment below for details.
[0077] The general process of using the above-mentioned material quality inspection system is as follows: The material enters the inspection area (including the spectral detection module 3 and the visual inspection module 4) through the feeding module 1 and the conveying module 2. First, the spectral detection module 3 performs spectral detection and uses an improved ResNet model to identify internal defects in the material. If an internal defect is detected, the defect type is marked. If there is no internal defect, the composition content of the material is calculated using a 1D-AlexNet model. Then, the visual inspection module 4 performs visual inspection and uses a deep learning model to identify external defects in the material. If external defects exist, the defect type is marked. The data processing unit integrates the detection results of internal defects, composition content, external defects, and external texture and classifies the material into different grades according to preset standards. The control unit controls the corresponding sorting mechanism 52 to perform actions according to different grades to complete the graded sorting of the material.
[0078] The following are method embodiments corresponding to the system embodiments described above. These embodiments can be implemented in conjunction with the above embodiments. The relevant technical details mentioned in the above embodiments remain valid in these embodiments, and will not be repeated here to avoid repetition. Correspondingly, the relevant technical details mentioned in these embodiments can also be applied to the above embodiments.
[0079] Figure 11 A flowchart of a material quality inspection method provided in another embodiment of the present invention, using the above-described material quality inspection system, the material quality inspection method includes the following steps:
[0080] S10: The material enters the detection area through the feeding module 1 and the conveying module 2. The spectral detection module 3 is used to perform spectral detection. The improved ResNet model is used to identify the internal defects of the material. If internal defects exist, the defect type is marked.
[0081] S20: If there are no internal defects, the composition content of the material is calculated using the AlexNet model;
[0082] S30: Visual inspection is performed using a visual inspection module. Based on a deep learning model, external defects of the material are identified. When external defects exist, the type of defect is marked.
[0083] S40: The sorting module is used to sort materials based on the type of defect and the content of components.
[0084] In other embodiments, the material quality inspection method may not employ the aforementioned material quality inspection system, but may include: performing spectral detection on the material upon entering the inspection area; using an improved ResNet model to identify internal defects in the material; labeling the type of defect if internal defects exist; calculating the component content of the material using an AlexNet model if no internal defects exist; performing visual inspection; identifying external defects in the material based on a deep learning model; labeling the type of defect if external defects exist; and completing the sorting of the material based on the defect type and component content.
[0085] In step S10 of this embodiment, as follows Figure 12 As shown, the improved ResNet model is constructed using the following steps:
[0086] S100: The diameter D of the sample is obtained using a laser rangefinder, in mm.
[0087] S101: One-dimensional transmission spectrum data of the sample were acquired using a visible-near-infrared spectrometer, and the one-dimensional transmission spectrum data were optimized using the diameter D. The optimization formula is Equation (1):
[0088] I adjusted =I0×e μD ×(1+αΔT) (1),
[0089] Among them, I adjustedThe optimized spectral intensity is expressed in au (arbitrary units). I0 is the spectral intensity of the incident light in the one-dimensional transmission spectral data. αΔT is a correction factor used for temperature compensation; α is the temperature compensation coefficient, which represents the sensitivity of the spectral signal to temperature changes (usually 1 / ℃). ΔT is the temperature change, which refers to the deviation of the actual ambient temperature from the standard measurement temperature (e.g., 25℃).
[0090] S102: Generate the first dataset by preprocessing the optimized spectral intensity data;
[0091] S103: Collect the reflection image data of the sample, extract texture features, and define the reflection image dataset with texture features as the second dataset; the reflection image data comes from the visual detection module.
[0092] S104: Dynamically weight and merge the first and second datasets to generate the third dataset;
[0093] S105: Augment the third dataset, label it, and divide it into training set, validation set, and test set;
[0094] S106: Train the improved ResNet model using the labeled training set, and validate and test it using the validation and test sets;
[0095] S107: Optimize the improved ResNet model using a hybrid loss function.
[0096] In other embodiments, the construction steps of the improved ResNet model replace step S100 with obtaining the diameter D of the sample in mm; and replace "acquiring one-dimensional transmission spectrum data of the sample using a visible and near-infrared spectrometer" in step S101 with "acquiring one-dimensional transmission spectrum data of the sample", while other steps remain unchanged.
[0097] In step S100 of this embodiment, when obtaining the diameter D of the sample (taking a potato as an example in this embodiment), since the position of the bottom of the sample is fixed, the diameter D of the sample can be reflected by measuring the distance from the detection point of the laser rangefinder 35 to the sample surface. Since potatoes are not perfectly spherical, the measured diameter is not very precise; it only provides a relative material size parameter for calibration. Several sets of data from the potato detection can be compared using the laser rangefinder 35. When the distance from the detection point of the laser rangefinder 35 to the potato surface is the smallest, the potato diameter is the largest, and the diameter calculated at this point can be considered the potato diameter D.
[0098] In step S102, the preprocessing may include one or more of the following: min-max normalization, Z-score standardization, maximum normalization, normalization to [-1,1], first derivative normalization, standard normal variable transformation, etc.
[0099] In step S103, the visual inspection module 4 is used to acquire the reflection image data of the sample, and then the texture features are extracted. Canny edge detection and Hough transform can be used to calculate and extract the size and shape features of the potato tubers. Texture features are extracted based on methods such as gray-level co-occurrence matrix (GLCM), local binary mode (LBP), and Gabor filtering.
[0100] In step S104, the formula for dynamic weighted fusion is as follows (2):
[0101] FFAF=α1Xspectral+β1Xtexture (2),
[0102] In equation (2), Xspectral represents the first dataset, Xtexture represents the second dataset, FFAF represents the third dataset, and α1 and β1 are the fusion weights, calculated using the SE (Squeeze-and-Excitation) module:
[0103] α1=σ(W2·ReLU(W1·Xspectral)),
[0104] β1=σ(W2·ReLU(W1·Xtexture)),
[0105] σ represents the Sigmoid function, which makes the weights between (0,1), where W1 and W2 are trainable weight matrices used to calculate the adaptive fusion weights of spectral features and image features.
[0106] The final feature is expressed as follows (3):
[0107] FFAF=α1Xspectral+(1-α1)Xtexture (3).
[0108] In step S105, the third dataset is augmented using one or more data augmentation methods such as randomly adding Gaussian noise, vertical translation, and random cropping. The images are augmented using methods such as rotation, flipping, blurring, adding noise, and changing brightness. The third dataset is labeled with diameter, defect type, and component content (such as internal defects like black cores and hollow cores, and components like dry matter and soluble sugars), and divided into a training set (70%), a validation set (20%), and a test set (10%).
[0109] In step S106, the improved ResNet model includes: modifying the residual structure of the ResNet model with more than 128 channels (such as...). Figure 13 The ordinary convolution in (as shown) is replaced with an adaptive depthwise separable convolution (such as...). Figure 14 As shown), the weights of the depthwise and pointwise convolutions in the adaptive depthwise separable convolution are generated in real time based on the input data; an adaptive attention mechanism is added to the third and fourth residual blocks of the ResNet model, such as... Figure 15 As shown, the adaptive attention mechanism includes dynamically generating convolutional kernels and attention weights. Figure 15 "Adaptive Selection of Kernel Size" indicates that the size of the convolution kernel k is adaptively selected, for example, k=5. "Depthwise Convolution" refers to depthwise convolution, and "Pointwise Convolution" refers to pointwise convolution.
[0110] Specifically, the ordinary convolutions in the residual structure of the basic one-dimensional ResNet model with more than 128 channels are transformed into adaptive depthwise separable convolutions (DWSC) to achieve a lightweight network structure without affecting recognition accuracy. Figure 14 This diagram illustrates ordinary convolution and depthwise separable convolution (this diagram is existing technology, for illustrative purposes only, and is not intended to be protected). Figure 14 In Chinese, "Depthwise" also means depthwise convolution, and "Pointwise" also means pointwise convolution.
[0111] The steps to improve the adaptive depthwise separable convolution (DWSC) include:
[0112] For input spectral data X∈R C×L Input the spectral matrix, where C is the number of channels and L is the spectral length or number of sampling points for each channel.
[0113] Based on the statistical characteristics (such as mean, standard deviation, sample thickness, and other auxiliary information) of the input spectral data X (one-dimensional transmission data or reflectance spectral data, obtained by the spectral detection module 3), the weights of the depth convolution are dynamically generated as shown in the following formula (4).
[0114] W depth =f depth (Stats(X)) (4),
[0115] Among them, W depth The weights represent the depthwise convolution weights, Stats(X) represents the statistical properties of the input spectral data, which may include information such as mean, standard deviation, sample thickness, maximum value, and minimum value, fdepth (·) represents a dynamic weight generation function that outputs the weights of the depthwise convolution kernel based on statistical features;
[0116] The weights for point-by-point convolution between channels are dynamically generated based on the statistical characteristics of the input spectral data.
[0117] Dynamically generate the weights for pointwise convolution between channels based on the input characteristics:
[0118] W point =f point (Stats(X)) (5)
[0119] f point : Dynamic weight generation function.
[0120] Therefore, the output features of the adaptive depthwise separable convolutional (DWSC) are:
[0121]
[0122] In equation (6), Cin represents the number of input feature maps or input channels, Cout represents the number of output feature maps or output channels, and K represents the size of the convolution kernel (filter).
[0123] The improved adaptive attention mechanism (ECA, EfficientChannel Attention) is added to the residual structure with a certain number of channels. The improved adaptive attention mechanism ECA is added to the third and fourth residual blocks in the basic ResNet model. ECA efficiently implements a local wide-channel interaction strategy without involving dimension reduction through 1D convolution.
[0124] The improved adaptive attention mechanism (ECA) includes selecting global pooling and dynamic kernel size, specifically comprising the following steps:
[0125] For input spectral features X∈R C×L Perform global average pooling (e.g.) Figure 15 The statistical characteristics of each channel are obtained by taking the GAP in the equations (7) to (9) below:
[0126]
[0127] Among them, Z c X: The global average pooling value of the c-th channel, used to represent the statistical characteristics of that channel; c,i is the value of the i-th position in the c-th channel of the input feature matrix; L: the feature length of each channel (i.e., the sequence length of the spectral channels); c: the channel index, c = 1, 2, 3, ..., C; i: the position index within the channel, i = 1, 2, 3, ..., L.
[0128] Dynamically adjust the kernel size k to adapt to the channel dependencies of different input data:
[0129] k = g k (Stats(X)) (8)
[0130] Where g(k) is a function that generates the kernel size based on the input statistical properties;
[0131] Dynamic convolution is used to capture the interaction between channels and generate channel attention weights, as shown in equation (9):
[0132]
[0133] Where w j The value is generated by the dynamically generated function w j =g w (Stats(X)) is used for calculation.
[0134] X' c,i =α c ×X c,i ,
[0135] By introducing a dynamic adjustment mechanism, the selection of whether and how to add samples is flexibly made based on sample characteristics, and the optimization target formula is as follows (10):
[0136] L attention =L task +λ k ·||g k (Stats(X))-k optical || 2 +λ w ·||g w (Stats(X))|| 2
[0137] (10),
[0138] Where: L task Let λ represent the loss function. k and λ w To control the constraints on convolutional kernel size and weight generation; k optimal The optimal kernel size is set based on experience.
[0139] Therefore, the residual blocks of the improved one-dimensional ResNet model have the following characteristics:
[0140] Improved Adaptive Depthwise Separable Convolution (DWSC): Weights for depthwise and pointwise convolutions are generated in real-time based on the input data. Improved Adaptive Attention Mechanism (ECA): The attention mechanism's addition strategy is adjusted based on input characteristics, including dynamically selecting the convolution kernel size and generating weights.
[0141] The residual block output formula of the improved one-dimensional ResNet model is as follows (11):
[0142] Y=ReLU(DynamicECA(DynamicDWSC(X))+X) (11),
[0143] DynamicDWSC: Represents Dynamically Depthwise Separable Convolution; DynamicECA: Represents Adaptive Attention Module;
[0144] The parameter generation of the improved adaptive depthwise separable convolution (DWSC) and the improved adaptive attention mechanism (ECA) is achieved through the joint optimization objective function of the following equation (12):
[0145]
[0146] in, and α optimal λ and η represent the empirically optimal depth convolution weights and attention weights, respectively; λ and η control the regularization strength.
[0147] In step S107, a combined loss function is used for optimization, as shown in equation (13):
[0148] L=λ1L CE +λ2L Focal +λ3L Huber (13),
[0149] Where λ1, λ2, and λ3 are hyperparameters used to control the weights of different loss terms;
[0150] L CE Cross-Entropy Loss: C represents the total number of categories;
[0151]
[0152] y i Represents the one-hot encoding of the true category, if y i =1, then the loss value is mainly due to Decide, This represents the class probability predicted by the model.
[0153] If the model predicts a low probability of correctly classing ( If the loss is small, the loss will be greater;
[0154] If the model predicts a high probability of correctly classing ( If the value is close to 1, the loss will be smaller.
[0155] L Focal Focal Loss:
[0156]
[0157] γ (Gamma hyperparameter): controls the degree of attention given to difficult-to-classify samples;
[0158] Where γ = 0, it degenerates into cross-entropy loss, and γ > 1, it strengthens the penalty for low-confidence samples (hard-to-classify samples).
[0159] L Huber Huber Loss (Smoothing Mean Squared Error Loss):
[0160]
[0161] Where y represents the true value (such as dry matter content); δ represents the predicted value (such as the dry matter content predicted by the model); δ represents the threshold that determines when to switch between mean squared error (MSE) and mean absolute error (MAE).
[0162] In step S20, the composition content of the material is calculated using deep learning models such as AlexNet. Specifically, the composition content of the material, such as dry matter, starch, protein, reducing sugar, acidity, and soluble sugar, is calculated using a 1D-AlexNet model.
[0163] In step S30, the visual inspection module 4 is used to detect the texture features and external defects (such as black spots, cracks, insect damage, mechanical damage, frost damage, etc.) of materials such as potatoes. The detection model can consider using deep learning methods such as convolutional neural networks (CNNs), such as improved ResNet, ResNet, Inception, or models specifically designed for object detection such as Faster R-CNN, YOLO, SSD, etc. to detect external defects.
[0164] In step S40, the data processing unit classifies materials into different grades according to preset standards. For each material, it comprehensively considers the type and degree of internal defects, component content, and the type and degree of external defects to determine an overall quality score or directly classify it into a specific grade. The control unit integrates the detection results of internal defects, component content, and external defects to control the corresponding sorting mechanism 52 to complete the graded sorting of materials.
[0165] This invention, for example, trains an improved ResNet model (e.g., an improved one-dimensional ResNet18 model) using the PyTorch framework and uses TensorBoard to visualize the detection results, thus achieving the detection of black-hearted potatoes. TensorBoard, or TensorDisplay, is a visualization tool specifically designed for the TensorFlow framework for monitoring and analyzing the TensorFlow training process. Through TensorBoard, users can visualize the model structure, view changes in metrics such as loss and accuracy over time, observe the distribution of weights and biases, and perform other types of debugging and performance analysis. This invention was tested on a test set of 386 transmission spectrum data points, and the results are shown in Table 1. The improved one-dimensional ResNet18 model (Modified ResNet18) (e.g.) Figure 16 As shown, the complexity was reduced by 62.71%, while the accuracy was improved by 4.18%.
[0166] Table 1 Test Results
[0167]
[0168] Figure 17 This is a schematic diagram of the structure of an electronic device 300 provided in an embodiment of the present invention. Specifically, the electronic device 300 may include at least one processor 301 and at least one memory 302. The memory 302 stores a computer program 303, which is loaded and executed by the processor 301 to implement the relevant steps in the material quality detection method disclosed in any of the foregoing embodiments, such as... Figure 11 or Figure 12 The steps are shown.
[0169] In addition, the memory 302, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, and the storage method can be temporary storage or permanent storage.
[0170] In addition to including a computer program capable of performing the material quality inspection method executed by the electronic device 300 as disclosed in any of the foregoing embodiments, computer program 303 may further include a computer program capable of performing other specific tasks.
[0171] Another embodiment of the present invention discloses a computer storage medium storing computer-executable instructions. When these computer-executable instructions are loaded and executed by a processor, they implement the steps of the material quality detection method disclosed in any of the foregoing embodiments, such as... Figure 11 or Figure 12 The steps are shown.
[0172] In summary, the material quality inspection system of this invention integrates conveying, inspection, and grading functions, enabling rapid and automated quality assessment and grading of various materials such as potatoes, sweet potatoes, jicama, apples, pears, and eggplants. It combines spectral detection and multi-mode detection technologies to identify material types, internal defects, and component content analysis. Employing adjustable fiber optic probes and light sources, the system allows for combined detection of multiple modes, including diffuse reflection, diffuse transmission, and transmission, by flexibly adjusting the distance and angle of the light source and probe. It also supports simultaneous measurement across multiple modes, angles, and positions. The conveying mechanisms ensure stable material transport, effectively preventing mechanical damage and collisions. This material quality inspection system is highly efficient, automated, and applicable to multiple materials, providing a precise and intelligent solution for online quality inspection and grading of materials (especially tubers), and possesses significant potential for widespread adoption.
[0173] This invention optimizes the algorithm and proposes a material quality detection method. It uses a ResNet18 model with depth-separable convolution and an efficient channel attention mechanism adapted to one-dimensional spectral data for internal quality identification. The convolution kernel and attention weights are dynamically generated, and the structure of the attention mechanism is flexibly adjusted to comprehensively improve the model's adaptability to sample characteristics. While improving detection accuracy, the model remains compact and suitable for resource-constrained hardware environments, meeting the real-time online detection needs of industrial production lines.
[0174] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms fall within the scope of protection of the present invention.
Claims
1. A material quality inspection system, comprising a feeding module, a conveying module, a spectral detection module, a visual inspection module, a sorting module, and an information management module, wherein the information management module is connected to the feeding module, the conveying module, the spectral detection module, the visual inspection module, and the sorting module; the conveying module is connected to the discharge end of the feeding module; characterized in that, The spectral detection module is located downstream of the transmission module and includes a dark box, a visible and near-infrared spectrometer, multiple fiber optic probes, multiple first light sources, multiple second light sources, a laser ranging sensor, and an adjustable frame. A portion of the downstream side of the transmission module passes through the dark box. The adjustable frame is located on the inner wall of the dark box and above the transmission module. The multiple fiber optic probes, the multiple first light sources, and the laser ranging sensor are mounted on the adjustable frame. The information management module controls the movement of the adjustable frame, thereby driving the movement of the multiple fiber optic probes, the multiple first light sources, and the laser ranging sensor. The multiple second light sources are located inside the dark box and below the transmission module. The transmission module has acquisition holes located inside the dark box. The multiple fiber optic probes, the multiple first light sources, the multiple second light sources, and the laser ranging sensor are positioned corresponding to the acquisition holes. The multiple fiber optic probes are connected to the visible and near-infrared spectrometer. The sorting module is connected to the discharge end of the conveying module; The visual inspection module is located at the feeding end of the sorting module.
2. The material quality inspection system according to claim 1, characterized in that, The adjustable frame includes a first support plate, a first adjustment component, a connecting rod, and two second adjustment components, wherein: The first support plate is disposed on the inner wall of the dark box; The first adjustment component includes a first slider, a first slide rail, and an electric push rod. The first slide rail is vertically disposed on the first support plate and located directly above the acquisition hole. The first slider moves vertically along the first slide rail under the drive of the electric push rod. At least one of the plurality of fiber optic probes and the laser ranging sensor are mounted on the first slider. The connecting rod passes through the first slider and is horizontally positioned with the first slider located in the middle of the connecting rod; the two second adjustment components are symmetrically arranged at both ends of the connecting rod. Each of the second adjustment components includes a transmission rod, a second slide rail, and a second slider. The transmission rod is connected to one end of the connecting rod. The second slide rail is disposed on the first support plate. The second slider slides along the second slide rail under the drive of the transmission rod. The second slide rail has an angle with the first slide rail. The remaining plurality of fiber optic probes are mounted on the second slider.
3. The material quality inspection system according to claim 2, characterized in that, The second slider includes an arc-shaped wall and a sliding part. The sliding part is connected to the middle of the arc-shaped wall. The sliding part slides along the second slide rail under the drive of the transmission rod. The remaining plurality of fiber optic probes are disposed on the arc-shaped wall and symmetrically located on both sides of the sliding part. At least one of the first light sources is disposed in the middle of each arc-shaped wall.
4. The material quality inspection system according to claim 1, characterized in that, The feeding module includes a first conveying mechanism and a sorting mechanism, wherein: The first conveying mechanism is inclined, and a baffle hopper is provided at the feed end; The sorting mechanism is located at the discharge end of the first conveying mechanism and includes a first V-shaped groove, two first conveyor belts and a first brush roller. The two first conveyor belts are arranged in a V-shape and are correspondingly arranged in the first V-shaped groove. The first brush roller is located above the first conveyor belt and is in gentle contact with the material on the first conveyor belt. The axis of the first brush roller is parallel to the traveling direction of the first conveyor belt.
5. The material quality inspection system according to claim 4, characterized in that, The conveying module includes a second V-groove, two second conveyor belts, and a second brush roller, wherein: The two second conveyor belts are arranged in a V-shape within the second V-shaped groove, and the two second conveyor belts are connected to the two first conveyor belts; The second brush roller is located above the upstream of the second conveyor belt and makes gentle contact with the material on the second conveyor belt. The axis of the second brush roller is perpendicular to the travel direction of the second conveyor belt. The spectral detection module is located downstream of the second conveyor belt.
6. The material quality inspection system according to claim 5, characterized in that, The sorting module includes a first sorting unit and multiple second sorting units, wherein; The first sorting unit is connected to the discharge end of the conveying module, and the vision detection module is located at the feed end of the first sorting unit. The first sorting unit includes a second conveying mechanism and multiple sorting action mechanisms. The second conveying mechanism is connected to the two second conveyor belts, and multiple movable material trays are provided on the second conveying mechanism. Each sorting action mechanism corresponds to at least one material tray. The plurality of sorting mechanisms correspond to the plurality of second sorting units respectively; Each sorting mechanism, according to the instructions of the information management module, causes the material in the corresponding material tray to fall into the corresponding second sorting unit.
7. The material quality inspection system according to claim 6, characterized in that, The material holder includes a roller bracket and rollers, with the rollers rotatably mounted in the roller bracket; The second conveying mechanism includes a conveying chain, on which multiple connecting plates are spaced apart; The roller bracket is mounted on the connecting plate and is driven to tilt by the corresponding sorting action mechanism.
8. The material quality inspection system according to claim 7, characterized in that, The connecting plate has a support slot, and a support block is provided in the support slot; the roller bracket is connected to a U-shaped support rod, and the middle part of the U-shaped support rod is supported in the support slot by the top of the support block; the material tray tilts to the side with the support slot as the fulcrum.
9. The material quality inspection system according to claim 6, characterized in that, The sorting mechanism includes a swing arm, a cylinder, and a rotating shaft, wherein: One end of the swing arm is connected to the cylinder and is hinged to the frame of the first sorting unit via the rotating shaft. The swing arm is driven by the cylinder to rotate upward around the rotating shaft. As the swing arm rotates upward, the other end of the swing arm pushes against one side of the corresponding material tray, causing the material tray to tip over.
10. The material quality inspection system according to claim 1, characterized in that, The information management module includes interconnected data processing units and control units, wherein: The data processing unit is connected to the spectral detection module and the visual detection module. The data processing unit is used to identify internal and external defects of the material, label the types of defects, and calculate the composition content of the material. The control unit connects to and controls the feeding module, the conveying module, the spectral detection module, the visual detection module, and the sorting module. The control unit is used to control the sorting module according to the type of defect and the content of the components to complete the sorting of materials.
11. The material quality inspection system according to claim 10, characterized in that, The data processing unit uses an improved ResNet model to determine internal defects in materials. The improved ResNet model includes: In the ResNet model, ordinary convolutions in the residual structure with more than 128 channels are replaced with adaptive depthwise separable convolutions. The weights of the depthwise convolutions and pointwise convolutions in the adaptive depthwise separable convolutions are generated in real time based on the input data. An adaptive attention mechanism is added to the third and fourth residual blocks of the ResNet model. This adaptive attention mechanism includes dynamically generating convolutional kernels and attention weights.
12. A method for detecting the quality of materials, characterized in that, The material quality inspection system according to any one of claims 1 to 11 includes the following steps: The material enters the detection area through the feeding module and the conveying module, and is subjected to spectral detection using the spectral detection module. The improved ResNet model is used to identify the internal defects of the material, and if internal defects are found, the defect type is marked. If there are no internal defects, the composition content of the material is calculated using the AlexNet model; Visual inspection is performed using a visual inspection module, and external defects of the material are identified based on a deep learning model. When external defects are present, the type of defect is marked. The sorting module is used to sort the materials according to the type of defect and the content of the components.
13. The material quality testing method according to claim 12, characterized in that, The improved ResNet model is constructed using the following steps: The diameter D of the sample is obtained using the laser rangefinder. One-dimensional transmission spectrum data of the sample were acquired using a visible-near-infrared spectrometer, and the one-dimensional transmission spectrum data were optimized using the diameter D. The optimization formula is as follows: I adjusted =I0×e μD ×(1+αΔT), Among them, I adjusted The optimized spectral intensity is I0, where I0 is the spectral intensity of the incident light in the one-dimensional transmission spectral data, αΔT is the correction factor used for temperature compensation, α is the temperature compensation coefficient, and ΔT is the temperature change. The optimized spectral intensity data is preprocessed to generate the first dataset; Collect the reflection image data of the sample, extract texture features, and define the reflection image dataset with the texture features as the second dataset; The first and second datasets are dynamically weighted and merged to generate a third dataset. The third dataset is augmented and labeled, and divided into a training set, a validation set, and a test set. The labeling includes the label diameter, component content, and defect type. The improved ResNet model was trained using the labeled training set, and then validated and tested using the validation and test sets. The improved ResNet model is optimized using a hybrid loss function.
14. The material quality testing method according to claim 13, characterized in that, The improved ResNet model includes: In the ResNet model, ordinary convolutions in the residual structure with more than 128 channels are replaced with adaptive depthwise separable convolutions. The weights of the depthwise convolutions and pointwise convolutions in the adaptive depthwise separable convolutions are generated in real time based on the input data. An adaptive attention mechanism is added to the third and fourth residual blocks of the ResNet model. This adaptive attention mechanism includes dynamically generating convolutional kernels and attention weights.
15. A computer-readable storage medium, characterized in that, Used to store a computer program; when the computer program is executed by a processor, it implements the material quality detection method as described in any one of claims 12 to 14.
16. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the material quality testing method as described in any one of claims 12 to 14.
Citation Information
Patent Citations
Online nondestructive testing (NDT) method and device for comprehensive internal / external qualities of fruits
CN101949686A
Airfield lighting system model for landing training
RU2042981C1