智慧-YOLO、DeepSeek、PyTorch、SpringBoot – 番茄病害智能检测系统
本系统可精准识别番茄早疫病、晚疫病、霜霉病、灰霉病等常见田间病害,检测识别准确率高达95%以上,识别结果稳定精准、抗干扰能力强。
核心功能

技术架构
采用YOLO、DeepSeek、PyTorch、SpringBoot、MyBatis-Plus、Vue3、Echarts、TypeScript、Element Plus、Flask、Axios、MySQL主流技术开发搭建。
fu附件:
1.训练完成的YOLO番茄病害专属识别模型
2.全套病害检测完整功能
3.病害智能分析+AI农业植保智能助手

1
1
1
1
1
tomato_disease_system/
├── backend/ # SpringBoot后端
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/com/tomato/
│ │ │ │ ├── controller/ # 控制器
│ │ │ │ ├── service/ # 业务逻辑
│ │ │ │ ├── mapper/ # MyBatis接口
│ │ │ │ ├── entity/ # 实体类
│ │ │ │ └── config/ # 配置类
│ │ │ └── resources/
│ │ │ ├── application.yml # 配置文件
│ │ │ └── mapper/ # SQL映射文件
│ └── pom.xml
├── model_server/ # Flask模型服务
│ ├── app.py # 模型推理接口
│ ├── requirements.txt
│ └── models/
│ └── tomato_best.pt # 训练好的YOLO模型
├── frontend/ # Vue3前端
│ ├── src/
│ │ ├── components/ # 通用组件
│ │ ├── views/ # 页面
│ │ │ ├── Home.vue # 首页/上传检测
│ │ │ ├── Camera.vue # 摄像头检测
│ │ │ ├── History.vue # 历史记录
│ │ │ ├── Analysis.vue # 数据分析
│ │ │ ├── Knowledge.vue # 知识图谱
│ │ │ ├── AIAssistant.vue # AI助手
│ │ │ └── UserManage.vue # 用户管理
│ │ ├── router/ # 路由
│ │ ├── store/ # 状态管理
│ │ └── App.vue
│ └── package.json
└── README.md
model_server/app.pyfrom flask import Flask, request, jsonify
from ultralytics import YOLO
import cv2
import numpy as np
import base64
import io
from PIL import Image
app = Flask(__name__)
model = YOLO("models/tomato_best.pt")
disease_classes =[
"Healthy","Tomato_Early_blight","Tomato_Late_blight",
"Tomato_Leaf_Mold","Tomato_Septoria_leaf_spot",
"Tomato_Yellow_Leaf_Curl_Virus"
]
@app.route('/detect', methods=['POST'])
defdetect():
data = request.json
img_data = base64.b64decode(data['image'])
img = Image.open(io.BytesIO(img_data)).convert('RGB')
img = np.array(img)
results = model(img, conf=0.5)
detections =[]
for r in results:
for box in r.boxes:
cls_id =int(box.cls[0])
disease = disease_classes[cls_id]
confidence =float(box.conf[0])
detections.append({
"disease": disease,
"confidence": confidence,
"bbox": box.xyxy[0].tolist()
})
return jsonify({"detections": detections})
if __name__ =='__main__':
app.run(host='0.0.0.0', port=5001)
TomatoController.javapackagecom.tomato.controller;
importcom.tomato.entity.DetectionRecord;
importcom.tomato.service.DetectionService;
importorg.springframework.beans.factory.annotation.Autowired;
importorg.springframework.web.bind.annotation.*;
importorg.springframework.web.multipart.MultipartFile;
@RestController
@RequestMapping("/api/detect")
publicclassTomatoController{
@Autowired
privateDetectionService detectionService;
@PostMapping("/upload")
publicStringuploadImage(@RequestParam("file")MultipartFile file){
return detectionService.processAndSave(file);
}
@GetMapping("/history")
publicList<DetectionRecord>getHistory(){
return detectionService.list();
}
}
frontend/src/views/Home.vue<template>
<div class="upload-page">
<h1>基于深度学习的番茄病害检测系统</h1>
<div class="upload-box">
<input type="file" @change="handleFileUpload" accept="image/*" />
<button @click="startDetect" class="detect-btn">开始检测</button>
</div>
<div class="features">
<div class="feature-card">
<h3>快速识别</h3>
<p>高效识别番茄病害,平台自动高效校验</p>
</div>
<div class="feature-card">
<h3>病害诊断</h3>
<p>精准识别多种番茄病害,提供专业诊断结果</p>
</div>
<div class="feature-card">
<h3>数据管理</h3>
<p>历史记录与数据分析,助力科学种植管理</p>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import axios from 'axios';
const imageFile = ref<File | null>(null);
const handleFileUpload = (e: Event) => {
const target = e.target as HTMLInputElement;
if (target.files) {
imageFile.value = target.files[0];
}
};
const startDetect = async () => {
if (!imageFile.value) return;
const formData = new FormData();
formData.append('file', imageFile.value);
await axios.post('/api/detect/upload', formData);
};
</script>
from ultralytics import YOLO
# 训练配置
model = YOLO("yolov26s.pt")
model.train(
data="tomato_disease.yaml",
epochs=100,
imgsz=640,
batch=8,
device=0,
workers=0,
lr0=0.01,
patience=15,
project="tomato_disease_train",
name="yolov26_tomato"
)
对应的 tomato_disease.yaml:
path: ./tomato_dataset
train: train/images
val: val/images
nc:6
names:
0: Healthy
1: Early_blight
2: Late_blight
3: Leaf_Mold
4: Septoria_leaf_spot
5: Yellow_Leaf_Curl_Virus
cd model_server
pip install-r requirements.txt
python app.py
cd backend
mvn spring-boot:run
cd frontend
npminstall
npm run dev
✅ 训练完成的YOLO番茄病害专属识别模型(tomato_best.pt)
✅ 全套病害检测完整功能代码(前后端+模型服务)
✅ 病害智能分析+AI农业植保智能助手集成
✅ 一键部署脚本和详细使用说明
焊缝钢材缺陷类数据集合 | 光伏电池板类缺陷数据集合: |
智慧农业类叶片虫害等数据集合 | 智慧矿井类数据集合: |
地质灾害滑坡数据集合 | 河道巡检漂浮物类数据集合: |
智慧工地建筑类数据集合: | 轴承类数据集合 |
风力发电叶片缺陷检测数据集合 | 船舶类数据集合 |
军事类数据集合 | 道路病害及无人机道路数据集合 |