Agricultural loan credit evaluation method and device based on crop counting, equipment and medium
By improving the YOLOv10 model and ByteTrack algorithm, the accuracy and real-time performance of crop counting were achieved, solving the problems of inaccurate counting and inability to be directly applied to loan credit in the existing system, and improving the efficiency of credit assessment and credit risk control capabilities.
Patent Information
- Application Number
- CN202511892981.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-03-03
AI Technical Summary
Existing agricultural management systems suffer from issues such as duplicate or missed counts in crop counting, making it impossible to achieve real-time dynamic counting and unsuitable for direct application in bank loan approval, leading to increased costs and time consumption.
An improved YOLOv10 target detection model combined with the ByteTrack algorithm is used to generate the shooting motion trajectory of crops by identifying the location information and confidence level of crops in video frames, and agricultural loan credit assessment is carried out based on this counting result.
It has achieved accuracy and real-time crop counting, reduced labor costs and subjective errors, improved credit assessment efficiency, and provided financial institutions with reliable technical support for credit risk control and inclusive finance.
Smart Images

Figure CN121599758A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target recognition technology, and in particular to a method, apparatus, equipment and medium for agricultural loan credit assessment based on crop counting. Background Technology
[0002] With the large-scale development of modern agriculture in my country, the level of digitalization and intelligence in agricultural production is constantly improving. Accurately grasping crop quantities is not only an important requirement for agricultural management, but also a crucial foundation for banks to achieve digital risk control in loan granting and risk management. Traditional manual investigation methods are time-consuming, costly, and lack timely information, making it difficult to meet the needs of banks in inclusive finance and rural revitalization.
[0003] Currently, some agricultural management systems based on computer vision technology have emerged in the industry. These systems are mainly used for crop identification, yield estimation, or pest and disease monitoring to improve agricultural production efficiency. However, the design goals of these systems are mostly focused on agricultural production management and have not been optimized for banking credit and risk control scenarios, resulting in significant shortcomings in actual financial business. First, existing solutions typically rely on static images for identification, failing to achieve real-time dynamic counting based on video streams. This can easily lead to double counting or missed counting in high-density crop environments, affecting data accuracy. Second, existing systems lack seamless integration with banking credit systems, preventing the direct application of crop quantity data to loan approval and risk control models. This forces banks to still manually verify farmers' planting scale, increasing costs and time consumption. Furthermore, some existing technologies lack sufficient detection accuracy in complex greenhouse environments, making it difficult to meet the requirements of financial business for data authenticity and accuracy.
[0004] In summary, how to accurately count crops in planting scenarios and conduct agricultural loan credit assessments based on the counting results is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a method, apparatus, equipment, and medium for agricultural loan credit assessment based on crop counting, which can accurately count crops in a planting scenario and conduct agricultural loan credit assessment based on the counting results. The specific solution is as follows:
[0006] Firstly, this application provides a method for assessing agricultural loan credit based on crop counts, including:
[0007] Obtain target videos of target planting areas collected by target farmers, and extract several video frames from the target videos;
[0008] The target detection model is used to identify and locate several target crops in each video frame, and to output the target location information and the target confidence of the target location information for each target crop in each video frame; the target detection model is an improved version of the YOLOv10 model.
[0009] Using the ByteTrack algorithm, based on the target location information and target confidence level of each target crop in each video frame, the target shooting motion trajectory of each target crop in the target video is generated;
[0010] Based on the motion trajectory of each target, a crop count result corresponding to the target planting area is generated, and based on the crop count result, an agricultural loan credit assessment result corresponding to the target farmer is generated.
[0011] Optionally, the step of acquiring target videos of target planting areas collected by target farmers and extracting several video frames from the target videos includes:
[0012] The target video of the target planting area is acquired by the target farmer through a target acquisition device; the target acquisition device consists of a smartphone and a gimbal stabilizer.
[0013] Several video frames are extracted from the target video based on a preset extraction interval.
[0014] Optionally, before identifying and locating several target crops in each of the video frames using a pre-trained target detection model, the method further includes:
[0015] The convolutional modules of the YOLOv10 model are improved using a receptive field attention convolutional structure to obtain the target improved model;
[0016] The backbone network in the target improvement model is replaced with the MobileNetV4 network architecture to obtain an initial detection model, and the initial detection model is trained to obtain the target detection model.
[0017] Optionally, training the initial detection model to obtain the target detection model includes:
[0018] A number of initial crop images are acquired, and data augmentation processing is performed on the initial crop images to obtain a number of target crop images; the number of target crop images is greater than the number of initial crop images, and both the initial crop images and the target crop images include preset normal crop images and preset abnormal crop images. The preset abnormal crop images include preset blurred crop images, crop images acquired under preset low light conditions, occluded crop images, and crop images from non-frontal viewpoints.
[0019] Each labeled image is obtained by labeling the variety of each target crop image with LabelImg, and each labeled image is divided into a training set, a validation set, and a test set based on a preset division ratio;
[0020] The initial detection model is trained using the training set and the validation set, and the mean accuracy corresponding to the output result of the initial detection model is optimized during the training process to obtain the trained model.
[0021] The performance of the trained model is tested using the test set, and the target detection model is determined based on the test results and the trained model.
[0022] Optionally, generating the target shooting motion trajectory of each target crop in the target video based on the target location information and target confidence level corresponding to each target crop in each of the video frames includes:
[0023] For any target crop in the current video frame, determine whether the target confidence corresponding to the current target location information of the target crop is greater than a preset confidence threshold;
[0024] If so, the matching degree between the current target location information and any generated first shooting motion trajectory is determined. If the matching degree is greater than a preset matching degree threshold, the first shooting motion trajectory is updated based on the current target location information, and the target shooting motion trajectory corresponding to the target crop in the target video is determined based on the updated first shooting motion trajectory.
[0025] If not, and the current target location information does not deviate from the planting area corresponding to the target planting site, then from the video frames preceding the current video frame, determine the crop to be determined whose location overlap with the target crop is greater than a first preset threshold and whose appearance similarity is greater than a second preset threshold. If the current target location information matches the second shooting motion trajectory already generated for the crop to be determined, then update the second shooting motion trajectory based on the current target location information, and determine the target shooting motion trajectory corresponding to the target crop in the target video based on the updated second shooting motion trajectory.
[0026] Optionally, the process of generating the target shooting motion trajectory of each target crop in the target video using the ByteTrack algorithm based on the target location information and target confidence level corresponding to each target crop in each video frame further includes:
[0027] For any of the target crops, check whether there are any missing video frames between the video frames corresponding to the target shooting motion trajectory of the target crop;
[0028] If it exists, then based on the trajectory interpolation algorithm, the predicted trajectory information of the target crop in the lost video frame is generated, and the target shooting motion trajectory is updated based on the predicted trajectory information. Based on the updated shooting motion trajectory, the target shooting motion trajectory corresponding to the target crop is re-determined.
[0029] Optionally, the agricultural loan credit assessment method based on crop counts further includes:
[0030] The target video of the target planting area collected by the target farmer is obtained through the target mini-program, and the crop counting results corresponding to the target video of the target planting area are displayed through the target mini-program, so as to generate the agricultural loan credit assessment result corresponding to the target farmer based on the crop counting results displayed by the target mini-program.
[0031] Secondly, this application provides an agricultural loan credit assessment device based on crop counting, comprising:
[0032] The video frame extraction module is used to acquire target videos of target planting areas collected by target farmers and extract several video frames from the target videos.
[0033] The target crop identification module is used to identify and locate several target crops in each video frame using a pre-trained target detection model, and to output the target location information of each target crop in each video frame and the target confidence score of the target location information; the target detection model is an improved version of the YOLOv10 model.
[0034] The target shooting motion trajectory generation module is used to generate the target shooting motion trajectory of each target crop in the target video by using the ByteTrack algorithm, based on the target location information and the target confidence level corresponding to each target crop in each video frame;
[0035] The agricultural loan credit assessment module is used to generate crop counting results corresponding to the target planting area based on the motion trajectory of each target, and to generate agricultural loan credit assessment results corresponding to the target farmer based on the crop counting results.
[0036] Thirdly, this application provides an electronic device, comprising:
[0037] Memory, used to store computer programs;
[0038] A processor is used to execute the computer program to implement the aforementioned agricultural loan credit assessment method based on crop counts.
[0039] Fourthly, this application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned agricultural loan credit assessment method based on crop counting.
[0040] In this application, firstly, target videos of target planting areas collected by target farmers are acquired, and several video frames are extracted from the target videos; then, a pre-trained target detection model is used to identify and locate several target crops in each of the video frames, and the target location information and target confidence scores of each target crop in each video frame are output; the target detection model is an improved version of the YOLOv10 model; subsequently, the ByteTrack algorithm is used to generate target shooting motion trajectories of each target crop in the target video based on the target location information and target confidence scores of each target crop in each video frame; finally, a crop counting result corresponding to the target planting area is generated based on the target shooting motion trajectories, and an agricultural loan credit assessment result corresponding to the target farmer is generated based on the crop counting result. As can be seen from the above, this application first acquires target videos of the planting areas collected by the target farmers and extracts video frames. Then, using an improved YOLOv10 target detection model, it accurately identifies the target location information and corresponding target confidence scores of the target crops in each video frame. Subsequently, using the ByteTrack algorithm, it generates continuous target shooting motion trajectories for each target crop in the target video based on the target location information and target confidence scores. Finally, it counts the crops in the target planting area based on the target shooting motion trajectories and uses the crop count results as the core basis to generate agricultural loan credit assessment results for the target farmers. In this way, this application not only reduces labor costs and subjective errors but also significantly improves the efficiency of credit assessment, providing reliable technical support for financial institutions to accurately control credit risks and expand agricultural credit services. It realizes the credible application of agricultural data in financial business and promotes the digital transformation of inclusive finance. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0042] Figure 1 A flowchart of an agricultural loan credit assessment method based on crop counting, provided for this application;
[0043] Figure 2 A specific target detection model framework diagram is provided for this application;
[0044] Figure 3 A specific crop illustration provided for this application;
[0045] Figure 4 This application provides a specific flowchart for generating shooting motion trajectories;
[0046] Figure 5 A flowchart illustrating a specific trajectory interpolation optimization strategy provided in this application;
[0047] Figure 6 A schematic diagram of a specific crop counting applet provided in this application;
[0048] Figure 7 A specific crop counting system architecture diagram is provided for this application;
[0049] Figure 8 A schematic diagram of an agricultural loan credit assessment device based on crop counting, provided for this application;
[0050] Figure 9 This application provides a structural diagram of an electronic device. Detailed Implementation
[0051] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] With the large-scale development of modern agriculture in my country, the level of digitalization and intelligence in agricultural production is constantly improving. Accurately determining crop quantities is not only a crucial requirement for agricultural management but also a vital foundation for banks to achieve digital risk control in loan granting and risk management. Traditional manual survey methods are time-consuming, costly, and lack timely information, making them unsuitable for banks' needs in inclusive finance and rural revitalization. Currently, some agricultural management systems based on computer vision technology have emerged in the industry. These systems are mainly used for crop identification, yield estimation, or pest and disease monitoring to improve agricultural production efficiency. However, the design goals of these systems are mostly focused on agricultural production management and have not been optimized for bank lending and risk control scenarios, resulting in significant shortcomings in actual financial operations. Therefore, this application provides an agricultural loan credit assessment scheme based on crop counting, which can accurately count crops in a planting scenario and conduct agricultural loan credit assessments based on the counting results.
[0053] See Figure 1 As shown in the figure, this invention discloses an agricultural loan credit assessment method based on crop counting, which may include:
[0054] Step S11: Obtain the target video of the target planting area collected by the target farmer, and extract several video frames from the target video.
[0055] In this embodiment, the process of acquiring target videos of target planting areas collected by target farmers and extracting several video frames from the target videos may include: acquiring the target videos of the target planting areas collected by the target farmers through target acquisition devices; the target acquisition devices consisting of smartphones and gimbal stabilizers; and extracting several video frames from the target videos based on preset extraction intervals.
[0056] Specifically, the target planting site can be a greenhouse setting or a planting site in other scenarios. This embodiment uses a greenhouse setting for specific explanation. First, the target farmer acquires target video of the target planting site using a target acquisition device consisting of a smartphone and a gimbal stabilizer. Then, several video frames are extracted from the target video based on a preset extraction interval. The preset extraction interval can adopt a strategy of extracting one frame every 20 frames, approximately 0.67 seconds, to avoid redundant information between adjacent video frames and to ensure that the extracted video frames fully cover the changes in plant morphology under different lighting conditions.
[0057] Step S12: Identify and locate several target crops in each video frame using a pre-trained target detection model, and output the target location information of each target crop in each video frame and the target confidence of the target location information; the target detection model is an improved version of the YOLOv10 model.
[0058] It should be noted that, due to the insufficient ability of the YOLOv10 model to represent small target features, it is prone to missed detections and false detections. In this embodiment, the convolutional module of the YOLOv10 model is improved using the RFAConv (Receptive Field Augmentation Convolution) structure to obtain an improved target detection model. The RFAConv structure can effectively capture target information of different scales and shapes through multi-scale receptive field enhancement and adaptive feature fusion mechanism, thereby improving the network's ability to perceive fine-grained details and edge features and reducing the missed detection rate and false detection rate. At the same time, in order to reduce computational complexity and improve the inference speed of the model, the backbone network in the improved target detection model is replaced with the MobileNetV4 network architecture to obtain the initial detection model. Then, the initial detection model is trained to obtain the target detection model. The MobileNetV4 network architecture adopts a depthwise separable convolution and optimized feature fusion strategy, which reduces the number of parameters and computational overhead while maintaining strong feature representation capabilities, enabling the model to run efficiently on resource-constrained edge devices and meet the needs of real-time detection of video streams.
[0059] In this embodiment, to train the initial detection model to obtain the target detection model, the specific process may include: first, acquiring videos of several planting areas; then, extracting several video frames to obtain several initial crop images; and performing data augmentation processing on the initial crop images to obtain several target crop images; the number of target crop images is greater than the number of initial crop images; both the initial crop images and the target crop images include preset normal crop images and preset abnormal crop images; the preset abnormal crop images include preset blurred crop images and crops collected under preset low light conditions. Images, occluded crop images, and crop images from non-frontal viewpoints are used. Then, each target crop image is labeled with its variety using LabelImg to obtain labeled images. These labeled images are then divided into training, validation, and test sets based on a preset partitioning ratio. Subsequently, the initial detection model is trained using the training and validation sets, and the mean accuracy corresponding to the output results of the initial detection model is optimized during training to obtain a trained model. Finally, the performance of the trained model is tested using the test set, and the target detection model is determined based on the test results and the trained model.
[0060] Specifically, in this embodiment, a dataset for training the initial detection model is constructed through data acquisition, data extraction, data augmentation, data annotation, and data partitioning.
[0061] During data acquisition, a front-view acquisition method was adopted, using a gimbal-stabilized mobile phone for shooting. This avoided image blurring caused by unstable shooting equipment or handheld shooting, ensuring clear identification of crop images. Specifically, the acquisition device consisted of a smartphone and a gimbal stabilizer. The video data captured by the phone was transmitted in real-time to a storage device for subsequent processing and analysis. Taking strawberry seedlings as an example, they were planted densely, with a plant spacing of 5cm and a row spacing of 20cm, ensuring the representativeness and breadth of the subsequently constructed dataset. Video data was recorded via mobile phone at a resolution of 1920×1080 and a frame rate of 30fps to ensure clear capture of strawberry seedling details. Stable lighting conditions inside the greenhouse contributed to improved image quality, guaranteeing the accuracy and consistency of data acquisition.
[0062] During data extraction, scientific frame extraction was first performed on the acquired 1080p@30fps video. This frame extraction was implemented using Python code, employing a strategy of extracting one frame every 20 frames (approximately 0.67 seconds) to avoid redundant information between adjacent video frames and to ensure the extracted frames adequately cover plant morphological changes under different lighting conditions. Ultimately, 6164 representative initial crop images were extracted from the video sequence. These initial crop images included challenging samples with motion blur, low light, different angles, and partial occlusion. For example, strawberry seedlings are shown in [reference needed]. Figure 3 As shown, Figure 3 In the image, (a) represents a motion-blurred crop image. Figure 3 (b) in the image represents an image of obscured crops. Figure 3 (c) in the image represents crop images acquired under preset low-light conditions. Figure 3 (d) in the text indicates tilt. The collected crop images. It should be noted that motion-blurred crop images simulate the imaging blur caused by wind turbine disturbances or equipment movement, which can improve the model's adaptability to dynamic scenes; low-light scenes such as cloudy days and dusk enhance the model's detection stability under non-ideal lighting conditions; by preserving complex situations such as leaf occlusion and plant overlap, the model's target recognition ability in densely planted environments is trained; multi-angle samples ensure that the model can recognize plant features from different observation angles.
[0063] In the process of data augmentation, to improve the model's generalization ability in various real-world environments, this embodiment simulates complex situations that may be encountered in real-world planting environments. This enhances the model's applicability in actual planting and production environments by performing data augmentation on the initial crop images, resulting in several target crop images. Data augmentation can not only simulate changes in lighting, angle, background, and scale in different shooting scenarios, but also effectively expand the number of samples, mitigating the risk of overfitting caused by uneven sample distribution and improving the model's learning efficiency and recognition stability. The augmented target crop images are shown in Table 1.
[0064] Table 1
[0065]
[0066] In the data annotation process, the choice of annotation tool directly affects annotation efficiency and accuracy. Therefore, in this embodiment, manual annotation is performed using the open-source LabelImg tool, and corresponding annotation standards are formulated based on the special characteristics of crop cultivation, thereby obtaining annotated images. Addressing the challenges posed by intensive greenhouse cultivation, this embodiment adopts a "visible portion priority" approach for annotating target crop images: for partially occluded targets, such as those with a visible area greater than or equal to 30%, the smallest bounding rectangle of the visible area is annotated, and the target is labeled with "seed"; for completely occluded targets, no labeling is performed. All annotations are saved in YOLO format, containing normalized target center coordinates and width and height information. Statistical analysis after annotation shows that, on average, each video frame contains... One target crop.
[0067] In the process of data partitioning, a scientific and reasonable dataset partitioning has a decisive impact on the generalization performance of deep learning models. This embodiment adopts the standard partitioning method of training, validation, and test sets. By comparing and analyzing three common ratio schemes—6:2:2, 7:2:1, and 8:1:1—a 7:2:1 partitioning strategy was ultimately determined. 70% of the labeled image data is used for model training, 20% for parameter tuning, and 10% for final evaluation. This ensures sufficient training samples while guaranteeing the representativeness of the validation and test data.
[0068] Subsequently, the initial detection model can be trained using the constructed training and validation sets. During training, the mean average precision (mAP) corresponding to the output results of the initial detection model is optimized to obtain the trained model. Finally, the performance of the trained model is tested using the test set, and the target detection model is determined based on the test results and the trained model. Specifically, in this embodiment, mAP (mean Average Precision) is used as the core evaluation metric for model performance. mAP50 represents the average precision at an IoU (Intersection over Union) threshold of 0.5, and is an important indicator for measuring the accuracy of the target detection model under a relaxed matching standard. Experimental results show that when the dataset is divided in a 6:2:2 ratio, insufficient training data leads to inadequate feature learning, resulting in an mAP50 of 86.52%. When the dataset is divided in an 8:1:1 ratio, although the training data is sufficient, the validation and test sets are too small, and the standard deviation of the model's mAP50 performance evaluation metric reaches [missing value]. In contrast, the 7:2:1 partitioning strategy achieves the best balance between model capacity and evaluation requirements, with the standard deviation of mAP reaching [value missing]. The mAP metric is almost equal to that of the 8:1:1 partitioning strategy, demonstrating the best test stability. The comparison of each partitioning ratio is shown in Table 2.
[0069] Table 2
[0070]
[0071] See the framework of the object detection model. Figure 2 As shown, among which, by The labeled sections indicate the newly introduced RFAConv module and the MobileNetV4 backbone network architecture. The introduction of the RFAConv module enhances the model's multi-scale feature extraction and spatial detail capture capabilities, improving the accuracy of small target perception. Replacing the backbone network with the lightweight MobileNetV4 architecture reduces computational load and increases inference speed, enabling high-precision detection in greenhouse scenarios with complex lighting and dense vegetation. Through these two optimizations, this embodiment enhances the model's ability to detect small targets and improves overall inference efficiency, making it suitable for real-time crop monitoring and quantity statistics, providing reliable basic data support for subsequent crop counting and agricultural financial risk control.
[0072] In this way, the trained target detection model can be used to identify and locate several target crops in each video frame, and output the target location information of each target crop in each video frame, as well as the target confidence of the target location information, as input data for subsequent multi-target tracking.
[0073] Step S13: Using the ByteTrack algorithm, based on the target location information and target confidence level corresponding to each target crop in each video frame, generate the target shooting motion trajectory corresponding to each target crop in the target video.
[0074] It should be noted that in the target tracking stage, this embodiment can employ the ByteTrack algorithm to construct the association relationship between target crops across video frames, thereby enabling the statistical counting of the number of crops in the video stream. The ByteTrack algorithm can match target crops between consecutive video frames based on their target location information and target confidence level. It can also solve the multi-target data association problem through a greedy strategy, ensuring the uniqueness and stability of the trajectories of the same crop in the video sequence. This embodiment not only avoids duplicate counting but also maintains trajectory continuity when some target crops are occluded or temporarily lost, ensuring the accuracy of the statistical results.
[0075] In this embodiment, based on the target location information and target confidence level of each target crop in each video frame, a target shooting motion trajectory corresponding to each target crop in the target video is generated. The specific process may include: for any target crop in the current video frame, determining whether the target confidence level corresponding to the current target location information of the target crop is greater than a preset confidence threshold; if so, determining the matching degree between the current target location information and any generated first shooting motion trajectory; if the matching degree is greater than a preset matching degree threshold, updating the first shooting motion trajectory based on the current target location information, and determining the target shooting motion trajectory based on the updated first shooting motion trajectory. The target crop is described in the target video as having the target shooting motion trajectory; if not, and the current target location information does not deviate from the planting area corresponding to the target planting site, then from the video frames before the current video frame, a crop to be determined is identified whose position overlap with the target crop is greater than a first preset threshold and whose appearance similarity is greater than a second preset threshold. If the current target location information matches the second shooting motion trajectory already generated for the crop to be determined, then the second shooting motion trajectory is updated based on the current target location information, and the target shooting motion trajectory corresponding to the target crop in the target video is determined based on the updated second shooting motion trajectory.
[0076] Specifically, taking strawberry seedlings as an example, see... Figure 4As shown, in each video frame, the ByteTrack algorithm analyzes the strawberry seedling's motion trajectory, position changes, and confidence level to match the strawberry seedling in the video with existing trajectories, ensuring the consistency and accuracy of the strawberry seedling across multiple video frames. Specifically, for the strawberry seedling in the current video frame, it first determines whether the target confidence level corresponding to the strawberry seedling's target position information is greater than a preset confidence threshold. If the target confidence level is greater than the preset confidence threshold, tracking of the strawberry seedling is activated, and the matching degree between the strawberry seedling's target position information and any previously generated first-shot motion trajectory is calculated. If the matching degree is greater than a preset matching degree threshold, the matched first-shot motion trajectory is updated based on the current target position information, and the trajectory of the strawberry seedling is continuously tracked to further determine the target shooting motion trajectory corresponding to the strawberry seedling in the target video based on the updated first-shot motion trajectory. It should be noted that if the matching degree is less than or equal to the preset matching degree threshold, the target location information of the strawberry seedling does not match the generated first shooting motion trajectory. If the strawberry seedling target is lost, it is necessary to determine whether the strawberry seedling is being tracked. If the strawberry seedling is not being tracked, its location information is discarded; if it is being tracked, its trajectory is continuously updated. If the target confidence is less than or equal to the preset confidence threshold, it is determined whether the strawberry seedling meets the following conditions: the target location information of the current strawberry seedling does not deviate from the planting area corresponding to the target planting location; there are crops to be determined with a high degree of overlap in location and a high degree of appearance similarity to the current strawberry seedling in the video frames preceding the current video frame; and the target location information of the current strawberry seedling matches the generated second shooting motion trajectory of the crop to be determined. If all conditions are met, the crop to be determined can be identified as the strawberry seedling. Therefore, the second shooting motion trajectory can be updated based on the target location information of the current strawberry seedling, and the target shooting motion trajectory corresponding to the strawberry seedling in the target video can be determined based on the updated second shooting motion trajectory. It should be noted that if any condition is not met, it can be determined that the shooting motion trajectory of the strawberry seedling in the previous video frame was not matched, and if the strawberry seedling is not tracked within the time limit, the location information of the strawberry seedling is discarded.
[0077] It should be noted that, regarding potential issues such as occlusion, loss, or ID switching of the target crop in the video sequence, please refer to [link / reference needed]. Figure 5As shown, this embodiment introduces a trajectory interpolation optimization strategy to improve the stable tracking performance of the target. This embodiment utilizes the ByteTrack algorithm to generate the target shooting motion trajectory of each target crop in the target video based on the target location information and target confidence level corresponding to each target crop in each video frame. The process may further include: for any target crop, checking whether there are any missing video frames between the video frames corresponding to the target shooting motion trajectory of the target crop; if so, generating predicted trajectory information of the target crop in the missing video frames based on the trajectory interpolation algorithm, updating the target shooting motion trajectory based on the predicted trajectory information, and re-determining the target shooting motion trajectory corresponding to the target crop based on the updated shooting motion trajectory.
[0078] Specifically, this embodiment checks each video frame corresponding to the target crop's motion trajectory to determine if any video frames are missing. If so, a trajectory interpolation algorithm is executed to reasonably predict the target crop's trajectory position during the temporary loss of the target crop, and the target crop's motion trajectory is updated based on the predicted trajectory information, thereby restoring tracking of the target crop and maintaining its original ID. Finally, a stable target crop motion trajectory is output. In this way, the trajectory interpolation optimization strategy used in this embodiment can ensure that the target crop maintains the continuity of its motion trajectory after a brief period of occlusion, thereby reducing ID switching phenomena.
[0079] As can be seen, in this embodiment, after identifying and locating the target crop through the target detection model, the ByteTrack algorithm is used to track the trajectory of the target crop. The ByteTrack algorithm combines an efficient target matching mechanism with accurate trajectory prediction capabilities, enabling stable tracking of the target crop in each frame even in complex backgrounds, with rapid movement, or partial occlusion. Through the ByteTrack tracking algorithm, this embodiment not only accurately records the movement trajectory of each target crop but also avoids the loss of target crops due to detection interruptions or noise interference, thus ensuring the continuity and integrity of the movement trajectory. To improve tracking stability, this embodiment also introduces a trajectory interpolation strategy. In the event of a temporary loss or mismatch of the target crop, the trajectory of the target crop is estimated through an interpolation algorithm, ensuring that the tracking of the target crop is not affected by temporary loss or false detection. This eliminates tracking interruptions caused by partial occlusion, noise interference, or changes in target movement, ensuring the continuity of the tracking process.
[0080] Step S14: Generate crop counting results corresponding to the target planting area based on the motion trajectory of each target, and generate agricultural loan credit assessment results corresponding to the target farmer based on the crop counting results.
[0081] In this embodiment, crop counting results corresponding to the target planting area can be generated based on the target's shooting trajectory, with one count corresponding to each target's shooting trajectory. These crop counting results can then be provided to banks as reliable data references for farmers' planting scale in credit granting. The entire process is implemented in a high-concurrency architecture on the backend, optimized with deep learning inference to ensure real-time performance even in large-scale planting environments. The frontend can present the results via a mini-program, facilitating quick data access for farmers and bank account managers, reducing manual verification costs, and improving credit approval efficiency. For details, see [link to documentation]. Figure 6 As shown, in this embodiment, the target video of the target planting area collected by the target farmer can be obtained through the target mini-program, and the crop counting results corresponding to the target video of the target planting area can be displayed through the target mini-program, so as to generate the agricultural loan credit assessment result corresponding to the target farmer through the crop counting results displayed by the target mini-program; wherein, in this embodiment, the WeChat mini-program is used as the target mini-program.
[0082] In one specific implementation, see Figure 7 As shown, the system architecture for crop counting can be divided into three parts: dataset construction, crop counting, and system development. In the dataset construction part, a crop dataset for training the object detection model is constructed through data collection, data extraction, data augmentation, data annotation, and data partitioning. In the crop counting part, an object detection model using the RFAConv module and MobileNetV4 network architecture is introduced to perform object detection on the input video frame images, obtaining the target location information and target confidence of the target crops. Then, the crop's shooting trajectory is generated according to the ByteTrack algorithm, and a trajectory interpolation strategy is introduced to solve the ID loss and occlusion problems. Finally, the counting results are generated based on the trajectory and output. In the system development part, a crop counting system is designed and implemented, including a backend and a frontend. The backend adopts a high-concurrency architecture, while the frontend is based on a mini-program for convenient access, enabling farmers and bank staff to view planting scale data in real time. Meanwhile, the crop counting system is adapted to banking and financial business scenarios, and can interact with bank credit business to generate agricultural loan credit assessment results for farmers. This can reduce manual verification costs, improve risk control efficiency, and promote the digital and intelligent development of rural finance.
[0083] As can be seen from the above, in this embodiment, firstly, target videos of the target planting area collected by the target farmer are acquired, and several video frames are extracted from the target videos; then, a pre-trained target detection model is used to identify and locate several target crops in each video frame, and the target location information and target confidence of each target crop in each video frame are output; the target detection model is an improved YOLOv10 model; subsequently, the ByteTrack algorithm is used to generate the target shooting motion trajectory of each target crop in the target video based on the target location information and target confidence of each target crop in each video frame; finally, the crop counting result corresponding to the target planting area is generated based on the target shooting motion trajectory, and the agricultural loan credit assessment result corresponding to the target farmer is generated based on the crop counting result. As shown above, this embodiment first acquires target videos of the planting areas collected by the target farmers and extracts video frames. Then, using the improved YOLOv10 target detection model, it accurately identifies the target location information and corresponding target confidence scores of the target crops in each video frame. Subsequently, using the ByteTrack algorithm, it generates continuous target shooting motion trajectories for each target crop in the target video based on the target location information and target confidence scores. Finally, it counts the crops in the target planting area based on the target shooting motion trajectories and generates agricultural loan credit assessment results for the target farmers based on the crop count results. In this way, this embodiment not only reduces labor costs and subjective errors but also significantly improves the efficiency of credit assessment. It provides reliable technical support for financial institutions to accurately control credit risks and expand agricultural credit services, realizes the credible application of agricultural data in financial business, and promotes the digital transformation of inclusive finance.
[0084] Accordingly, see Figure 8 As shown in the illustration, this application also provides an agricultural loan credit assessment device based on crop counting, which may include:
[0085] The video frame extraction module 11 is used to acquire the target video of the target planting area collected by the target farmer, and extract a number of video frames from the target video.
[0086] The target crop identification module 12 is used to identify and locate several target crops in each of the video frames using a pre-trained target detection model, and to output the target location information of each target crop in each of the video frames and the target confidence score of the target location information; the target detection model is a model obtained by improving the YOLOv10 model;
[0087] The target shooting motion trajectory generation module 13 is used to generate the target shooting motion trajectory of each target crop in the target video based on the target location information and the target confidence level corresponding to each target crop in each video frame using the ByteTrack algorithm.
[0088] The agricultural loan credit assessment module 14 is used to generate crop counting results corresponding to the target planting area based on the motion trajectory of each target, and to generate agricultural loan credit assessment results corresponding to the target farmer based on the crop counting results.
[0089] In some specific embodiments, the video frame extraction module 11 may include:
[0090] The target video acquisition unit is used to acquire the target video of the target planting area collected by the target farmer through the target acquisition device; the target acquisition device consists of a smartphone and a gimbal stabilizer.
[0091] A video frame extraction unit is used to extract a number of video frames from the target video based on a preset extraction interval.
[0092] In some specific embodiments, the agricultural loan credit assessment device based on crop counts may further include:
[0093] The model improvement module is used to improve the convolutional module of the YOLOv10 model using the receptive field attention convolutional structure to obtain the target improved model;
[0094] The model training module is used to replace the backbone network in the target improved model with the MobileNetV4 network architecture to obtain an initial detection model, and to train the initial detection model to obtain the target detection model.
[0095] In some specific implementations, the model training module may include:
[0096] A data augmentation unit is used to acquire several initial crop images and perform data augmentation processing on the initial crop images to obtain several target crop images; the number of target crop images is greater than the number of initial crop images, and both the initial crop images and the target crop images include preset normal crop images and preset abnormal crop images. The preset abnormal crop images include preset blurred crop images, crop images acquired under preset low light conditions, occluded crop images, and crop images from non-frontal viewing angles.
[0097] The labeled image segmentation unit is used to obtain each labeled image by labeling the variety of each target crop image with LabelImg, and to divide each labeled image into a training set, a validation set and a test set based on a preset segmentation ratio;
[0098] The model training unit is used to train the initial detection model using the training set and the validation set, and to optimize the mean accuracy corresponding to the output result of the initial detection model during the training process, so as to obtain the trained model.
[0099] The target detection model determination unit is used to test the performance of the trained model using the test set, and determine the target detection model based on the test results and the trained model.
[0100] In some specific embodiments, the target shooting motion trajectory generation module 13 may include:
[0101] The condition judgment unit is used to determine, for any target crop in the current video frame, whether the target confidence corresponding to the current target location information of the target crop is greater than a preset confidence threshold.
[0102] The matching degree determination unit is used to determine the matching degree between the current target location information and any generated first shooting motion trajectory if the matching degree is greater than a preset matching degree threshold, update the first shooting motion trajectory based on the current target location information, and determine the target shooting motion trajectory corresponding to the target crop in the target video based on the updated first shooting motion trajectory.
[0103] The crop to be determined unit is used to determine, if no, and the current target location information does not deviate from the planting area corresponding to the target planting site, then from the video frames before the current video frame, a crop to be determined whose position overlap with the target crop is greater than a first preset threshold and whose appearance similarity is greater than a second preset threshold. If the current target location information matches the second shooting motion trajectory already generated for the crop to be determined, then the second shooting motion trajectory is updated based on the current target location information, and the target shooting motion trajectory corresponding to the target crop in the target video is determined based on the updated second shooting motion trajectory.
[0104] In some specific embodiments, the target shooting motion trajectory generation module 13 may further include:
[0105] The missing video frame detection unit is used to check whether there are any missing video frames between the video frames corresponding to the target shooting motion trajectory of any of the target crops.
[0106] The predicted trajectory information generation unit is used to generate, if present, the predicted trajectory information of the target crop in the lost video frame based on the trajectory interpolation algorithm, update the target shooting motion trajectory based on the predicted trajectory information, and redetermine the target shooting motion trajectory corresponding to the target crop based on the updated shooting motion trajectory.
[0107] In some specific embodiments, the agricultural loan credit assessment device based on crop counts may further include:
[0108] The crop counting result display module is used to obtain the target video of the target planting area collected by the target farmer through the target mini-program, and display the crop counting result corresponding to the target video of the target planting area through the target mini-program, so as to generate the agricultural loan credit assessment result corresponding to the target farmer through the crop counting result displayed by the target mini-program.
[0109] Furthermore, embodiments of this application also disclose an electronic device, Figure 9 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the agricultural loan credit assessment method based on crop counting disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0110] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0111] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0112] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the agricultural loan credit assessment method based on crop counting, which is executed by the electronic device 20 according to any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0113] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed agricultural loan credit assessment method based on crop counting. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0114] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0115] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0116] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0117] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0118] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for assessing agricultural loan credit based on crop counting, characterized in that, include: Obtain target videos of target planting areas collected by target farmers, and extract several video frames from the target videos; The target detection model is used to identify and locate several target crops in each video frame, and to output the target location information and the target confidence of the target location information for each target crop in each video frame; the target detection model is an improved version of the YOLOv10 model. Using the ByteTrack algorithm, based on the target location information and target confidence level of each target crop in each video frame, the target shooting motion trajectory of each target crop in the target video is generated; Based on the motion trajectory of each target, a crop count result corresponding to the target planting area is generated, and based on the crop count result, an agricultural loan credit assessment result corresponding to the target farmer is generated.
2. The agricultural loan credit assessment method based on crop counting according to claim 1, characterized in that, The process of acquiring target videos of target planting areas collected by target farmers and extracting several video frames from the target videos includes: The target video of the target planting area is acquired by the target farmer through a target acquisition device; the target acquisition device consists of a smartphone and a gimbal stabilizer. Several video frames are extracted from the target video based on a preset extraction interval.
3. The agricultural loan credit assessment method based on crop counting according to claim 1, characterized in that, Before identifying and locating several target crops in each video frame using a pre-trained target detection model, the method further includes: The convolutional modules of the YOLOv10 model are improved using a receptive field attention convolutional structure to obtain the target improved model; The backbone network in the target improvement model is replaced with the MobileNetV4 network architecture to obtain an initial detection model, and the initial detection model is trained to obtain the target detection model.
4. The agricultural loan credit assessment method based on crop counting according to claim 3, characterized in that, The step of training the initial detection model to obtain the target detection model includes: A number of initial crop images are acquired, and data augmentation processing is performed on the initial crop images to obtain a number of target crop images; the number of target crop images is greater than the number of initial crop images, and both the initial crop images and the target crop images include preset normal crop images and preset abnormal crop images. The preset abnormal crop images include preset blurred crop images, crop images acquired under preset low light conditions, occluded crop images, and crop images from non-frontal viewpoints. Each labeled image is obtained by labeling the variety of each target crop image with LabelImg, and each labeled image is divided into a training set, a validation set, and a test set based on a preset division ratio; The initial detection model is trained using the training set and the validation set, and the mean accuracy corresponding to the output result of the initial detection model is optimized during the training process to obtain the trained model. The performance of the trained model is tested using the test set, and the target detection model is determined based on the test results and the trained model.
5. The agricultural loan credit assessment method based on crop counting according to claim 1, characterized in that, The step of generating the target shooting motion trajectory of each target crop in the target video based on the target location information and target confidence level corresponding to each target crop in each of the video frames includes: For any target crop in the current video frame, determine whether the target confidence corresponding to the current target location information of the target crop is greater than a preset confidence threshold; If so, the matching degree between the current target location information and any generated first shooting motion trajectory is determined. If the matching degree is greater than a preset matching degree threshold, the first shooting motion trajectory is updated based on the current target location information, and the target shooting motion trajectory corresponding to the target crop in the target video is determined based on the updated first shooting motion trajectory. If not, and the current target location information does not deviate from the planting area corresponding to the target planting site, then from the video frames preceding the current video frame, determine the crop to be determined whose location overlap with the target crop is greater than a first preset threshold and whose appearance similarity is greater than a second preset threshold. If the current target location information matches the second shooting motion trajectory already generated for the crop to be determined, then update the second shooting motion trajectory based on the current target location information, and determine the target shooting motion trajectory corresponding to the target crop in the target video based on the updated second shooting motion trajectory.
6. The agricultural loan credit assessment method based on crop counting according to claim 1, characterized in that, The process of generating the target shooting motion trajectory of each target crop in the target video using the ByteTrack algorithm, based on the target location information and target confidence level corresponding to each target crop in each video frame, further includes: For any of the target crops, check whether there are any missing video frames between the video frames corresponding to the target shooting motion trajectory of the target crop; If it exists, then based on the trajectory interpolation algorithm, the predicted trajectory information of the target crop in the lost video frame is generated, and the target shooting motion trajectory is updated based on the predicted trajectory information. Based on the updated shooting motion trajectory, the target shooting motion trajectory corresponding to the target crop is re-determined.
7. The agricultural loan credit assessment method based on crop counts according to any one of claims 1 to 6, characterized in that, Also includes: The target video of the target planting area collected by the target farmer is obtained through the target mini-program, and the crop counting results corresponding to the target video of the target planting area are displayed through the target mini-program, so as to generate the agricultural loan credit assessment result corresponding to the target farmer based on the crop counting results displayed by the target mini-program.
8. An agricultural loan credit assessment device based on crop counting, characterized in that, include: The video frame extraction module is used to acquire target videos of target planting areas collected by target farmers and extract several video frames from the target videos. The target crop identification module is used to identify and locate several target crops in each video frame using a pre-trained target detection model, and to output the target location information of each target crop in each video frame and the target confidence score of the target location information; the target detection model is an improved version of the YOLOv10 model. The target shooting motion trajectory generation module is used to generate the target shooting motion trajectory of each target crop in the target video by using the ByteTrack algorithm, based on the target location information and the target confidence level corresponding to each target crop in each video frame; The agricultural loan credit assessment module is used to generate crop counting results corresponding to the target planting area based on the motion trajectory of each target, and to generate agricultural loan credit assessment results corresponding to the target farmer based on the crop counting results.
9. An electronic device, characterized in that, The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, which is loaded and executed by the processor to implement the agricultural loan credit assessment method based on crop counts as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store a computer program, which, when executed by a processor, implements the agricultural loan credit assessment method based on crop counting as described in any one of claims 1 to 7.