A method and system for detecting seedling tray sowing quality based on smart phone
By integrating the seedling tray sowing quality detection system on the smartphone and using the YOLACT target detection network and Bluetooth scale, the problems of complex detection and hardware inconvenience in the existing technology are solved, and efficient and accurate seedling tray sowing quality detection and soil stability analysis are achieved.
Patent Information
- Application Number
- CN202411613146.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-11-13
AI Technical Summary
Existing seedling tray sowing quality detection methods are complex and inefficient, the hardware system is not easy to carry, and it is unable to accurately determine the area to which seeds across multiple grids belong, especially the detection of ordinary seedling trays.
A smartphone-based seeding tray sowing quality detection method is adopted, which uses the YOLACT target detection network, combines image acquisition, preprocessing, data enhancement and model training, is integrated into the mobile phone app, adds soil stability detection, and realizes real-time weight data recording through a Bluetooth scale.
It improves detection efficiency and accuracy, reduces hardware costs, is applicable to various environments, can accurately detect seed areas across multiple grids, and quantify soil spreading quality through automatic recording functions.
Smart Images

Figure CN119579858B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of agricultural precision sowing detection, and in particular relates to a method and system for detecting seeding quality of a seedling tray based on a smart phone. Background Art
[0002] At present, the agricultural machinery appraisal department still uses manual inspection methods to inspect complete sets of equipment for seeding tray sowing. The staff manually selects the inspection area, divides the grid, and then observes the number of seeds in each grid with the naked eye, and manually enters the number into Excel for calculation. In addition, the soil stability inspection of complete sets of equipment has always been mainly manual. These methods are complex to calculate, inefficient, have large errors and are highly subjective. Modern seeding tray sowing quality inspections mostly use machine learning and deep learning technologies, relying on high-performance hardware systems. The prior art (CN117975345) discloses a method and system for detecting the sowing effect of seeding trays of a pneumatic precision seeder. It uses an improved YOLOv5 target detection network to train a seeding tray sowing detection model and deploy it on an industrial computer, realizing real-time acquisition of seeding tray images and then obtaining the number of rice in each hole. Although this method achieves high-precision detection based on a high-performance hardware system, its hardware system is inconvenient to carry. In addition, this method is mainly suitable for standard seeding tray detection, while ordinary seeding trays need to be divided into grids for detection, and it is impossible to accurately determine the area to which seeds across multiple grids belong. In order to solve the above technical problems, the present invention designs a method and system for detecting seeding quality of seedling trays based on a smart phone. Summary of the Invention
[0003] In response to the problems in the existing technology such as the complex process of seedling tray sowing quality detection and the difficulty of carrying hardware, the present invention provides a seedling tray sowing quality detection method and system based on a smartphone, which can accurately determine the area to which seeds across multiple grids belong. The method can also be integrated into a mobile phone app to improve detection efficiency and make it easy to carry. On this basis, soil stability detection is added to integrate the full process detection of the seedling tray sowing equipment set into one.
[0004] The present invention achieves the above technical objectives through the following technical means.
[0005] A method for detecting seeding quality of seedling trays based on a smartphone includes the following steps:
[0006] Step 1: Collect sowing images of the rice seedling tray sowing equipment to obtain the original dataset.
[0007] Step 2: Preprocess the original data set obtained in step 1. The preprocessing includes segmentation into fixed size, filtering, denoising, and distortion correction.
[0008] Step 3: Manually label the dataset preprocessed in step 2.
[0009] Step 4: Perform data augmentation on the dataset annotated in step 3 to improve the generalization ability of the model and create a rice seedling tray dataset. The data augmentation processing methods include enhancing image contrast, scaling, and adding blur effects.
[0010] Step 5: Input the rice seedling tray dataset processed in step 4 into the YOLACT target detection network for training and testing to obtain the rice seedling tray sowing quality detection model.
[0011] Step 6: Deploy the rice seedling tray sowing quality detection model trained in step 5 to the mobile phone. The model deployment uses the ncnn high-performance neural network forward computing framework.
[0012] Step 7: Develop an app for the seedling tray sowing quality inspection system. Select a seedling tray image and calculate and process it to obtain the seedling tray sowing space ratio and seeding uniformity qualification rate. The app is developed based on the Android studio platform and Java language. The OpenCV image processing library is selected based on functional requirements. The relevant required code is written, and the inspection results can be exported to Excel tables.
[0013] Step 8: Connect the Bluetooth scale to the rice seeding tray quality detection system app. Specifically, click on the mobile phone to connect to the Bluetooth device, and the rice seeding tray quality detection system app will automatically connect to the Bluetooth address set in the background. The Bluetooth scale will transmit the weight data to the mobile phone in real time for display, and the automatic recording function will be enabled at the same time. Users can intuitively view the line graph of weight changes through the application interface. The system calculates the standard deviation and coefficient of variation through the automatically recorded weight data, quantifies the fluctuation of sowing quality, and supports the automatic export function of reports.
[0014] Furthermore, the blank rate is the ratio of the number of blanks to the total number of blanks, and its calculation formula is as follows:
[0015]
[0016] Among them, k represents the number of spaces, and total represents the total number of grids;
[0017] For seeds that span different detection frames, the pixel area of the seed in different grids is calculated based on the seed segmentation results. The grid to which the seed belongs is determined based on the pixel area occupied by the seed in different grids.
[0018] While calculating the space rate, the number of seeds in each grid is counted. According to different agronomic requirements, the user enters the qualified range, records the qualified grid number, and calculates the seeding uniformity qualified rate RJ , the calculation formula is as follows:
[0019]
[0020] Where m represents the number of qualified grids.
[0021] Furthermore, the automatic recording function means that when the real-time weight detected by the Bluetooth scale is greater than 0.2kg and the fluctuation range is less than 0.01kg, the system automatically determines that it is stable, records the weight w1 at this time, and records it in the table and line graph; continuously records 10 plates (w1~w 10 ) After that, the calculation button on the app becomes clickable. Click the button to calculate the standard deviation and coefficient of variation. After the calculation is completed, the export button automatically becomes clickable. The user clicks to export the current record w1 to w 10 The report will be automatically saved to the default folder on the phone.
[0022] Furthermore, the user manually inputs the uniformity qualified range data through the qualified range button, and the number of seeds in each grid is recorded in the Excel table exported by the seedling tray sowing quality detection system app. The grids that exceed the uniformity qualified range and are detected as 0 are marked with other colors to facilitate user observation and recording.
[0023] A system for implementing the above-mentioned method for detecting seeding quality of seedling trays based on a smartphone, comprising:
[0024] The image acquisition module uses an image acquisition device to automatically collect image data of the seedling tray after sowing, and connects with the computer and mobile phone to transmit the image data;
[0025] The image processing module is deployed on the computer side and is used to pre-process and enhance the data collected by the image acquisition module;
[0026] The model training module is deployed on the computer side and performs model training and testing based on the data processed by the image processing module to obtain a rice seedling tray sowing quality detection model;
[0027] The image detection module is deployed on the mobile phone in the form of an app, including an image selection unit, an image compression unit, an input qualified range unit, an input grid unit, a seed detection unit, a space rate and uniformity detection unit, a grid magnification unit, a soil paving stability detection unit, and a report export unit;
[0028] An image selection unit, used to select the collected seedling tray image data from the mobile phone album;
[0029] The image compression unit is used to compress the image data of the rice seedling tray with higher pixels, ensuring that detection can be achieved even on mobile phones with poor hardware;
[0030] The qualified range input unit is used for the user to input the qualified range of the seeding uniformity qualified rate;
[0031] Input grid unit, used to divide grids of different sizes for different image inputs;
[0032] The seed detection unit is used to detect the seedling tray image selected by the user and transmit the seed detection results to the front end. The front end displays the number of seeds contained in the grid in the center of each grid according to the distribution of the detection results in the grid;
[0033] The space rate and uniformity detection unit calculates relevant indicators based on the detection results of the seed detection unit and displays them on the front end for users to record.
[0034] A grid magnification unit is used for allowing users to click on any grid to magnify the detection details in the grid;
[0035] The soil stability detection unit is used to connect to the Bluetooth scale 5 via a mobile phone app, transmit real-time weight data to the mobile phone and automatically record it. When the weight is stable and within the set range, the data is automatically saved. After recording 10 times, the standard deviation and coefficient of variation are calculated;
[0036] The report export unit is used to export the test report so that users can easily obtain the test results and analysis reports.
[0037] The present invention has the following beneficial effects:
[0038] The present invention integrates the rice seedling tray sowing quality detection method into a mobile phone app, utilizing portable devices for detection, avoiding the cumbersome steps of traditional manual detection methods and significantly improving detection efficiency. By using common smartphones and open-source tools, expensive hardware investment and the need for specialized equipment are avoided, reducing the overall cost of the detection system. Using the YOLACT target detection network, rice seedling tray images are precisely labeled and trained, accurately detecting the number of seeds in each grid, effectively improving detection accuracy and reducing the subjective errors caused by manual detection. This method is not only applicable to standard pot seedling trays, but can also accurately detect ordinary seedling trays through grid division technology, showing strong versatility. In addition, the present invention also incorporates a soil spreading stability detection module, which implements the automatic recording function of weighing data. By recording the weight data of each seedling tray in real time, the system can draw a line graph of weight changes, intuitively displaying the stability trend of the equipment's soil spreading. At the same time, the standard deviation and coefficient of variation are calculated, allowing users to quantify the fluctuations in soil spreading quality, thereby achieving a more comprehensive quality analysis. To enhance the user experience, the system also supports automatic report export, allowing users to easily obtain and share test results and analysis reports.
[0039] In summary, compared with existing methods that rely on high-performance hardware systems, the present invention can complete detection using a smartphone, making the device more convenient to carry and suitable for various environments such as fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 Schematic diagram of the image acquisition device according to the present invention;
[0041] Figure 2 Schematic diagram of the layout of the Bluetooth scale;
[0042] Figure 3 This is a flow chart of the method for detecting seeding quality in seedling trays based on a smartphone according to the present invention;
[0043] Figure 4 The interface diagram of the developed software;
[0044] Figure 5 This is a diagram showing the detection effect of the seedling tray sowing quality detection method based on a smartphone according to the present invention;
[0045] Figure 6 This is the soil stability test page.
[0046] In the figure: 1-camera; 2-seedling tray; 3-collection frame; 4-transmission device; 5-Bluetooth scale; DETAILED DESCRIPTION
[0047] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but the protection scope of the present invention is not limited thereto.
[0048] Reference Figure 3 The method for detecting seeding quality of seedling trays based on a smart phone in this embodiment includes the following steps:
[0049] Step 1: Preliminary image data collection: Figure 1 As shown, the camera 1 is set 650 mm above the seedling tray, and a fixed-size (100 mm * 120 mm) acquisition frame 3 is set below. After the seedling tray 2 is sown, it is transported to the bottom of the camera 1 via the conveyor 4. The camera 1 collects the seedling tray sowing image, obtains the original data set and transmits it to the computer for subsequent processing for model training.
[0050] Step 2: Image preprocessing, including cropping, distortion correction, and denoising.
[0051] Step 3: Preparation of sowing image dataset: Use the open source annotation tool Labelme to annotate the preprocessed rice seedling tray images.
[0052] Step 4: Data enhancement: Perform data enhancement on the annotated images, including enhancing image contrast, scaling, adding blur effects, etc., to expand the dataset.
[0053] Step 5: YOLACT model training: The dataset prepared in step 4 is input into the real-time instance segmentation target detection network (You Only Look At Coefficients, YOLACT) for training and testing. The model training parameters are set as follows: Batch size is set to 16, the number of iterations is set to 16, and the initial learning rate is set to 0.001. The learning rate is adjusted to 1 / 10 of the learning rate of the previous stage at 5000, 10000, and 15000 times of training, respectively, to obtain a trained rice seedling tray sowing quality detection model.
[0054] Through the above steps, the average precision (mAP@0.5) of the rice seedling tray sowing quality detection model is 91.06; the hardware and software platform settings are shown in Table 1 below:
[0055] Table 1 Software and hardware platform settings
[0056]
[0057] Step 6: Deploy the model to the Android phone: Export the trained model in step 5 to ONNX format, use the onnx2ncnn tool provided by the ncnn (a high-performance neural network inference computing framework) high-performance neural network forward computing framework to convert the ONNX model to ncnn format, and generate .param and .bin files; to improve the inference speed and reduce the model size, use the ncnn quantization tool to convert the model to the quantized INT8 format and generate the corresponding .param and .bin files; compile ncnn in Android Studio and integrate it into the Android project. When the application starts, use the ncnn interface to load the .param and .bin files and load the model into memory to prepare for inference; preprocess the input image (mean subtraction and normalization), input the preprocessed image into the ncnn inference interface, call the model for forward calculation, and obtain the original output tensor. The inference interface output of ncnn contains multiple tensors used to represent bounding box, category and mask information; the category and bounding box coordinates of each target are parsed, and the mask is applied to the corresponding bounding box area through the mask tensor output by the model to extract the precise outline of the corresponding target; threshold filtering is applied to the category score and mask to retain high-confidence targets and salient areas to eliminate noise; the parsed bounding box is drawn on the image and the mask area is superimposed; because the targets are relatively dense, multiple overlays will cause a cluttered page, and the subsequent processes are all developed based on masks, so the bounding box and confidence score are set to invisible in the software interface so that users can intuitively understand the recognition results.
[0058] Step 7: Software development: Based on the Android Studio platform, use the Java language, select the OpenCV image processing library according to functional requirements, develop the seedling tray sowing quality detection system app, design the application's user interface, including layout, color, icons, etc., write XML layout files, and implement the application's interface; integrate the OpenCV image processing library to implement image loading, preprocessing, display and other functions; integrate the YOLACT-ncnn model converted in step 6 into the application for image segmentation and seed detection; at the same time, implement user interaction functions, such as selecting the gallery, adjusting parameters, etc., and test on different Android devices to ensure the compatibility and stability of the application on various devices.
[0059] Step 8: Actual Field Testing: Reuse Figure 1 The device shown in FIG1 collects the original rice seedling tray image data through the camera 1 and transmits the data to the mobile phone album through the built-in software of the camera 1. The user opens the app, such as Figure 4As shown, click the gallery button to select the image to be detected and start detection.
[0060] Step 9: Grid division and grid input: The default grid size of the seedling tray sowing quality inspection system app is 10×10. When the user needs to set the grid size, such as Figure 4 As shown in the figure, clicking the Enter Grid button automatically displays a dialog box prompting the user to enter a new grid size. In this dialog box, the user can enter the desired grid size in the input box. After the user confirms the input, the system verifies the input to see if it is empty and attempts to convert the input to an integer. If the conversion is successful, the grid size parameter is updated and the user is notified of the updated grid size. If the input is invalid (such as empty or non-numeric), the user is prompted to enter a valid number. The system then divides the original image according to the number of grids entered by the user, calculates the width and length of each sub-region, and divides the regions one by one in rows and columns starting from the upper left corner.
[0061] Step 10: Detection of the number of seeds in the grid: First, the image is evenly divided into multiple grid cells of equal size according to the grid size set by the user; then, by traversing each pixel in the image, it is determined whether it belongs to the mask area of the detection target; if a pixel belongs to the target and has not been processed, it is marked as processed, and the grid cell to which it belongs is determined based on the position of the pixel in the image, and then the target pixel count of the grid cell is increased; the system traverses all grids, counts the number of targets in each grid, and finds the grid cell with the most pixels; after the detection is completed, the system visualizes the detection results by drawing grid lines and the number of targets in each grid, helping users to intuitively understand the distribution of targets in each grid cell.
[0062] In the above process, to avoid repeated drawing and resulting in incorrect counting, the mask state of each pixel is tracked through a Boolean array to ensure that the same area is not drawn repeatedly, thus avoiding redundant calculations and improving drawing efficiency. Whenever the mask pixel value changes, the current line segment is drawn in place to reduce unnecessary drawing operations. A two-dimensional array is used to record the number of targets in each grid cell, and the grid coordinates are calculated pixel by pixel to accurately map the distribution of detected targets to each grid. The drawn line width and text size are dynamically adjusted according to the image resolution and multiplied by the scaling factor to adapt them to images of different sizes. This ensures that images of different sizes are displayed consistently. In each grid, the system automatically counts the number of targets and marks them at the corresponding grid position. The target distribution is presented through a clear contrast between color and text, making it easy for users to intuitively judge the detection results.
[0063] In the above process, determining the grid unit to which it belongs means that since some seeds occupy multiple grids, in order to accurately locate the main position of each target, the code calculates the pixel number distribution of the grid where each detection target is located, and selects the grid with the largest number of target pixels as the "main grid", realizing the main position judgment of the target when it is distributed in multiple areas.
[0064] Step 11: Calculation of empty space rate: First, initialize two counters: one for recording the number of empty grid cells (emptyCells) and the other for calculating the total number of cells in the grid (totalCells). TotalCells is obtained by squaring the size of the grid. Then, use a double loop to traverse each cell of the entire grid and check the number of targets in each cell. If the number of targets in a grid cell is zero, add 1 to the emptyCells counter. Finally, calculate the empty space rate, that is, the percentage of empty grid cells to the total grid cells, by dividing emptyCells by totalCells and then multiplying by 100. This percentage represents the proportion of grid cells in the entire image where no targets are detected, and update the relevant display information. The detection results are as follows: Figure 5 shown.
[0065] Step 12: Enter the qualified range: Figure 4 As shown, the user can click the qualified range button to enter the corresponding qualified range, preparing for the subsequent calculation of the seeding uniformity qualified rate; the system first initializes a layout page for entering the minimum and maximum detection standards, and obtains the minimum and maximum values entered by the user in the input box; then sets a click event handler for the confirmation button. When the user clicks the confirmation button, the system starts processing the input; the system obtains the value entered by the user from the input box and attempts to convert these strings into integers; to ensure the validity of the input, the system will detect whether there is a format error or invalid input. If an error occurs, the system will capture the exception and perform error handling. When the input is verified, the system stores the valid minimum and maximum values in the Intent object for passing this data to other processing processes; then calls the setResult method to return the data and operation results to the main activity that called the interface, and sets the result code to RESULT_OK, indicating that the input is successful and valid; finally, returns to the main process to ensure that the qualified range set by the user can be correctly applied to the next detection or calculation step.
[0066] Step 13: Seeding uniformity pass rate test: The system initializes a counter (uniformCells) to count the number of grid cells with target numbers within the user-defined range; a double loop is used to traverse each cell of the entire grid; if the number of targets in a cell is between the minimum value (minRange) and the maximum value (maxRange) defined by the user, the uniformCells counter is incremented by 1 and the uniformity is calculated, that is, the percentage of grid cells with target numbers within the defined range; the calculation method is to divide uniformCells by totalCells and then multiply by 100 to get the percentage. The test result is as follows: Figure 5 shown.
[0067] Step 14: Grid Zoom: Based on the image's width and height, the width and height of each grid cell are calculated according to the preset number of grid divisions. The left, top, right, and bottom boundary coordinates of the target grid are calculated through multiplication using the row and column coordinates of the target grid. Using the specified boundaries of the original image, the image data of the target grid area is extracted through cropping, generating a new image as the zoomed-in view. The generated zoomed-in image is applied to the image view control, clearly displaying the contents of the zoomed-in area and displaying a close button to allow the user to close the zoomed-in view when they have finished viewing it. When the user clicks the close button, the zoomed-in view and the close button are hidden to return to the full image view.
[0068] Step 15: Soil laying stability test: This means that when the rice seedling tray equipment is in the working state of only laying soil, one tray is taken out every three trays, and 10 trays are taken out. The weight of each tray of soil is recorded, and the standard deviation and coefficient of variation are calculated to obtain the soil laying stability; refer to Figure 2 As shown, the Bluetooth scale 5 is arranged below the seedling tray complete set of equipment. After the seedling tray 2 is covered with soil, it is output with the conveyor roller. The inspection personnel extract the seedling tray 2 and place the Bluetooth scale 5 in the center position; refer to Figure 2 、 6 As shown, the present invention adopts the innovative "range fluctuation filtering" and "automatic recording" functions to obtain the weight data of the Bluetooth scale 5 in real time via Bluetooth. First, an allowable fluctuation range (0-0.01kg) is set in the application to ensure that weight changes within this range are ignored, thereby eliminating the influence of external interference and small fluctuations; in terms of data analysis, the software has a built-in chart library that supports real-time line charts to display the trend of weight changes, helping users to intuitively understand the weight fluctuations during the measurement process; when the real-time weight is detected to be greater than 0.2kg and the fluctuation range is less than 0.01kg, the system automatically determines it to be stable and records the weight w1 at this time, and records it in the table and line chart at the same time, without the need for users to manually click; at the same time, in order to consider the stability of the equipment, the manual recording function is retained, and users can freely choose automatic recording and manual recording; 10 disks (w1-w 10) After that, the Calculate button will become clickable. Click it to calculate the standard deviation and coefficient of variation. After the calculation is completed, the Export button will become clickable. The user can click to export the current record from w1 to w 10 Statistical indicators such as weight data, standard deviation and coefficient of variation are generated, and an Excel test report is automatically saved to the default folder of the mobile phone.
[0069] During the above process, the system has built-in functions such as zeroing, calibration, and real-time display of the Bluetooth scale 5, and also provides a low-battery reminder; below is the soil stability detection and recording module, which has both manual and automatic recording functions; a delete button is added to delete erroneous data caused by user misoperation. When the table is not fully recorded, the button is gray and cannot be clicked. After ten sets of data are recorded, the calculation button becomes bright and can be clicked to calculate the relevant parameters.
[0070] Steps 1 through 5 above are the initial steps for the detection system, including image acquisition and algorithm learning, providing sample data for the detection system's detection operations. By replacing the standardized seedling tray 2 and repeating steps 1 through 5 to add new sample data, this precision detection method can be applied to different seeding environments. The remaining steps are the implementation process of the detection method. This new precision detection method is characterized by high stability, strong applicability, and high detection accuracy.
[0071] This embodiment also provides a smartphone-based rice seeding tray quality detection system, including:
[0072] The image acquisition module automatically collects image data of seedling trays after sowing using image acquisition equipment and connects to the computer and mobile phone to transmit image data;
[0073] The image processing module is deployed on the computer side and is used to pre-process and enhance the data collected by the image acquisition module;
[0074] The model training module is deployed on the computer side and performs model training and testing based on the data processed by the image processing module to obtain a rice seedling tray sowing quality detection model;
[0075] The image detection module is deployed on the mobile phone and includes an image selection unit, an image compression unit, an input qualified range unit, an input grid unit, a seed detection unit, a space rate and uniformity detection unit, a grid magnification unit, a soil paving stability detection unit, and a report export unit.
[0076] An image selection unit, used to select the collected seedling tray image data from the mobile phone album;
[0077] The image compression unit is used to compress the image data of the rice seedling tray with higher pixels, ensuring that detection can be achieved even on mobile phones with poor hardware;
[0078] The qualified range input unit is used for the user to input the qualified range of the seeding uniformity qualified rate;
[0079] Input grid unit, used to divide grids of different sizes for different image inputs;
[0080] The seed detection unit is used to detect the seedling tray image selected by the user and transmit the seed detection results to the front end. The front end displays the number of seeds contained in the grid in the center of each grid according to the distribution of the detection results in the grid;
[0081] The space rate and uniformity detection unit calculates relevant indicators based on the detection results of the seed detection unit and displays them on the front end for users to record.
[0082] A grid magnification unit is used for allowing users to click on any grid to magnify the detection details in the grid;
[0083] The soil stability detection unit is used to connect to the Bluetooth scale 5 via a mobile phone app, transmit real-time weight data to the mobile phone and automatically record it. When the weight is stable and within the set range, the data is automatically saved. After recording 10 times, the standard deviation and coefficient of variation are calculated;
[0084] The report export unit is used to export the test report so that users can easily obtain the test results and analysis reports.
[0085] This embodiment further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the process of steps 9 to 15 above is implemented.
[0086] The embodiments described are preferred implementations of the present invention, but the present invention is not limited to the above implementations. Any obvious improvements, substitutions or modifications that can be made by those skilled in the art without departing from the essence of the present invention are within the scope of protection of the present invention.
Claims
1. A method for detecting seeding quality of rice seedling trays based on a smart phone, characterized in that: The process includes the following: Step 1: Use image acquisition equipment to capture the sowing images of the rice seedling tray sowing equipment, obtain the original data set and transmit it to the computer; Step 2: Preprocess the original data set on the computer, including segmentation, filtering, denoising, and distortion correction; Step 3: Manually annotate the preprocessed dataset using open source annotation tools; Step 4: Perform data augmentation on the labeled dataset to create a rice seedling tray dataset. Data augmentation includes enhancing image contrast, scaling, and adding blur effects. Step 5: Input the rice seedling tray dataset into the YOLACT target detection network for training and testing to obtain the rice seedling tray sowing quality detection model; Step 6: Deploy the rice seedling tray sowing quality detection model to the mobile phone based on the ncnn high-performance neural network forward computing framework; Step 7: Develop an app for the rice seedling tray sowing quality inspection system. Use the image acquisition device to collect sowing image data from the rice seedling tray sowing equipment again, and transfer the data to the mobile phone album. Use the app to identify and calculate the rice seedling tray sowing quality inspection system to obtain the rice seedling tray sowing space rate and sowing uniformity qualification rate, and export the inspection report. In step 7, the blank space rate of the seedling tray is calculated as follows: For seeds that span different detection frames, the pixel area of the seed in different grids is calculated based on the seed segmentation results. The grid to which the seed belongs is determined based on the pixel area occupied by the seed in different grids. While calculating the seeding space rate of the seedling tray, the number of seeds in each grid is counted. According to different agronomic requirements, the user enters the qualified range, records the qualified grid number, and then calculates the seeding uniformity qualified rate R J : Among them, m represents the number of qualified grids, k represents the number of spaces, and total represents the total number of grids; Step 8: Connect the seedling tray sowing quality detection system App with the Bluetooth scale (5), and the Bluetooth scale (5) transmits the weight data of the seedling tray (2) to the mobile phone for display in real time, and enables the automatic recording function to ensure that the user can intuitively view the weight change line graph through the application interface. At the same time, the standard deviation and coefficient of variation are calculated through the automatically recorded weight data to quantify the fluctuation of the sowing quality and export the detection report; In step 8, the automatic recording function means that when the real-time weight detected by the Bluetooth scale (5) is greater than 0.2kg and the fluctuation range is less than 0-0.01kg, the seedling tray sowing quality detection system App automatically determines that it is stable, records the weight w1 at this time, and records it in the table and line graph at the same time; the seedling tray sowing quality detection system App is provided with a calculation button and an export button. After continuously recording 10 trays, the seedling tray sowing quality detection system App calculates the standard deviation and the coefficient of variation. After the calculation is completed, the weight data, standard deviation and coefficient of variation statistical indicator report of the currently recorded 10 trays are exported, and the report is automatically saved to the default folder.
2. The method for detecting seeding quality of rice seed trays based on a smart phone according to claim 1, wherein: The user inputs the uniformity qualified range data into the seedling tray sowing quality detection system App in advance. The detection report exported by the seedling tray sowing quality detection system App is in the form of an Excel table. The Excel table records the number of seeds in each grid, and the grids that exceed the uniformity qualified range and the detection value is 0 are marked with different colors.
3. The method for detecting seeding quality of rice seed trays based on a smart phone according to claim 1, wherein: In step 6, when the model is deployed, the rice seedling tray sowing quality detection model trained in step 5 is exported to the ONNX format, and the quantization tool provided by the ncnn high-performance neural network forward computing framework is used to convert the model into the quantized INT8 format to generate corresponding .param and .bin files; ncnn is compiled in Android Studio and integrated into the Android project. When the application starts, the ncnn interface is used to load the .param and .bin files, and the model is loaded into the memory to prepare for detection; during detection, the input image is input into the ncnn reasoning interface, and the model is called for forward calculation to obtain the original output tensor. The ncnn reasoning interface output contains multiple tensors for representing the bounding box, category, and mask information, and the category and bounding box coordinates of each target are parsed. The mask tensor output by the model is used to apply the mask to the corresponding bounding box area to extract the precise outline of the corresponding target; threshold filtering is applied to the category score and mask to retain high-confidence targets and significant areas to exclude noise, and the parsed bounding box is drawn on the image, and the mask area is superimposed.
4. A system for implementing the method for detecting seeding quality of rice trays based on a smartphone according to claim 1, characterized in that: include: The image acquisition module automatically collects image data of seedling trays after sowing using image acquisition equipment and connects to the computer and mobile phone to transmit image data; The image processing module is deployed on the computer side and is used to pre-process and enhance the data collected by the image acquisition module; The model training module is deployed on the computer side and performs model training and testing based on the data processed by the image processing module to obtain a rice seedling tray sowing quality detection model; The image detection module is deployed on the mobile phone in the form of an app, including an image selection unit, an image compression unit, an input qualified range unit, an input grid unit, a seed detection unit, a space rate and uniformity detection unit, a grid magnification unit, a soil paving stability detection unit, and a report export unit; An image selection unit, used to select the collected seedling tray image data from the mobile phone album; An image compression unit, used for compressing the seedling tray image data with higher pixels; The qualified range input unit is used for the user to input the qualified range of the seeding uniformity qualified rate; Input grid unit, used to divide grids of different sizes for different image inputs; The seed detection unit is used to detect the seedling tray image selected by the user and transmit the seed detection results to the front end. The front end displays the number of seeds contained in the grid in the center of each grid according to the distribution of the detection results in the grid; The space rate and uniformity detection unit calculates relevant indicators based on the detection results of the seed detection unit and displays them on the front end for users to record; A grid magnification unit is used for allowing users to click on any grid to magnify the detection details in the grid; A soil paving stability detection unit is used to connect to a Bluetooth scale (5), transmit real-time weight data to a mobile phone and automatically record it. When the weight is stable and within the set range, the data is automatically saved. After recording 10 times, the standard deviation and coefficient of variation are calculated. The report export unit is used to export the test report for users to view in real time.
Citation Information
Patent Citations
Intelligent and constant precision seeding device for rice seedling raising in tray
CN107278434A
Intelligent constant-quantity precision seeding device for rice seedling tray seedling raising
CN113287393A